src/order_base.h
changeset 9336 3f75a2c5e0d3
parent 9335 18d3658adc60
child 9339 daaa2adbaf99
--- a/src/order_base.h	Sun Apr 06 07:22:26 2008 +0000
+++ b/src/order_base.h	Sun Apr 06 07:48:51 2008 +0000
@@ -28,6 +28,7 @@
 	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 @@
 	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 @@
 	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.