summaryrefslogtreecommitdiff
path: root/src/order_base.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/order_base.h')
-rw-r--r--src/order_base.h30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/order_base.h b/src/order_base.h
index ff0813613..b1f83b1c5 100644
--- a/src/order_base.h
+++ b/src/order_base.h
@@ -43,13 +43,13 @@ private:
CargoID refit_cargo; ///< Refit CargoID
-public:
- Order *next; ///< Pointer to next order. If NULL, end of list
-
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.
uint16 max_speed; ///< How fast the vehicle may go on the way to the destination.
+public:
+ Order *next; ///< Pointer to next order. If NULL, end of list
+
Order() : refit_cargo(CT_NO_REFIT), max_speed(UINT16_MAX) {}
~Order();
@@ -167,6 +167,30 @@ public:
/** Set the value to base the skip on. */
inline void SetConditionValue(uint16 value) { SB(this->dest, 0, 11, value); }
+ /** Get the time in ticks a vehicle should wait at the destination. */
+ inline uint16 GetWaitTime() const { return this->wait_time; }
+ /** Get the time in ticks a vehicle should take to reach the destination. */
+ inline uint16 GetTravelTime() const { return this->travel_time; }
+
+ /**
+ * Get the maxmimum speed in km-ish/h a vehicle is allowed to reach on the way to the
+ * destination.
+ * @return maximum speed.
+ */
+ inline uint16 GetMaxSpeed() const { return this->max_speed; }
+
+ /** Set the time in ticks a vehicle should wait at the destination. */
+ inline void SetWaitTime(uint16 time) { this->wait_time = time; }
+ /** Set the time in ticks a vehicle should take to reach the destination. */
+ inline void SetTravelTime(uint16 time) { this->travel_time = time; }
+
+ /**
+ * Set the maxmimum speed in km-ish/h a vehicle is allowed to reach on the way to the
+ * destination.
+ * @param speed Speed to be set.
+ */
+ inline void SetMaxSpeed(uint16 speed) { this->max_speed = speed; }
+
bool ShouldStopAtStation(const Vehicle *v, StationID station) const;
bool CanLoadOrUnload() const;
bool CanLeaveWithCargo(bool has_cargo) const;