summaryrefslogtreecommitdiff
path: root/src/order_base.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-06 07:48:51 +0000
committerrubidium <rubidium@openttd.org>2008-04-06 07:48:51 +0000
commitd6623cf6541af8cb27359b59b97cb9e47f61bd0e (patch)
treebf63686bb4da660cbcdc1074a869b5b86df60166 /src/order_base.h
parent8cd1795fe32fc2afaa75f48b8b62ff992bf8f618 (diff)
downloadopenttd-d6623cf6541af8cb27359b59b97cb9e47f61bd0e.tar.xz
(svn r12588) -Codechange: do not access the destination of an order directly.
Diffstat (limited to 'src/order_base.h')
-rw-r--r--src/order_base.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/order_base.h b/src/order_base.h
index 9fc7514ac..a7301687b 100644
--- a/src/order_base.h
+++ b/src/order_base.h
@@ -28,6 +28,7 @@ private:
friend const struct SaveLoad *GetOrderDescription(); ///< Saving and loading of orders.
OrderTypeByte type; ///< The type of order
+ DestinationID dest; ///< The destination of the order.
CargoID refit_cargo; ///< Refit CargoID
byte refit_subtype; ///< Refit subtype
@@ -36,7 +37,6 @@ public:
Order *next; ///< Pointer to next order. If NULL, end of list
uint8 flags;
- DestinationID dest; ///< The destionation of the order.
uint16 wait_time; ///< How long in ticks to wait at the destination.
uint16 travel_time; ///< How long in ticks the journey to this destination should take.
@@ -118,6 +118,20 @@ public:
void FreeChain();
/**
+ * Gets the destination of this order.
+ * @pre IsType(OT_GOTO_WAYPOINT) || IsType(OT_GOTO_DEPOT) || IsType(OT_GOTO_STATION).
+ * @return the destination of the order.
+ */
+ inline DestinationID GetDestination() const { return this->dest; }
+
+ /**
+ * Sets the destination of this order.
+ * @param destination the new destination of the order.
+ * @pre IsType(OT_GOTO_WAYPOINT) || IsType(OT_GOTO_DEPOT) || IsType(OT_GOTO_STATION).
+ */
+ inline void SetDestination(DestinationID destination) { this->dest = destination; }
+
+ /**
* Is this order a refit order.
* @pre IsType(OT_GOTO_DEPOT)
* @return true if a refit should happen.