(svn r12588) -Codechange: do not access the destination of an order directly.

This commit is contained in:
rubidium
2008-04-06 07:48:51 +00:00
parent 8cd1795fe3
commit d6623cf654
18 changed files with 116 additions and 108 deletions

View File

@@ -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.
@@ -117,6 +117,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)