|
@@ -165,12 +165,15 @@ public:
|
|
|
/** Get the order to skip to. */
|
|
|
inline void SetConditionSkipToOrder(VehicleOrderID order_id) { this->flags = order_id; }
|
|
|
/** Set the value to base the skip on. */
|
|
|
inline void SetConditionValue(uint16 value) { SB(this->dest, 0, 11, value); }
|
|
|
|
|
|
bool ShouldStopAtStation(const Vehicle *v, StationID station) const;
|
|
|
bool CanLoadOrUnload() const;
|
|
|
bool CanLeaveWithCargo(bool has_cargo) const;
|
|
|
|
|
|
TileIndex GetLocation(const Vehicle *v, bool airport = false) const;
|
|
|
|
|
|
/** Checks if this order has travel_time and if needed wait_time set. */
|
|
|
inline bool IsCompletelyTimetabled() const
|
|
|
{
|
|
|
if (this->travel_time == 0 && !this->IsType(OT_CONDITIONAL)) return false;
|
|
@@ -236,23 +239,34 @@ public:
|
|
|
* Get the last order of the order chain.
|
|
|
* @return the last order of the chain.
|
|
|
*/
|
|
|
inline Order *GetLastOrder() const { return this->GetOrderAt(this->num_orders - 1); }
|
|
|
|
|
|
/**
|
|
|
* Get the order after the given one or the first one, if the given one is the
|
|
|
* last one.
|
|
|
* @param curr Order to find the next one for.
|
|
|
* @return Next order.
|
|
|
*/
|
|
|
inline const Order *GetNext(const Order *curr) const { return (curr->next == NULL) ? this->GetFirstOrder() : curr->next; }
|
|
|
|
|
|
/**
|
|
|
* Get number of orders in the order list.
|
|
|
* @return number of orders in the chain.
|
|
|
*/
|
|
|
inline VehicleOrderID GetNumOrders() const { return this->num_orders; }
|
|
|
|
|
|
/**
|
|
|
* Get number of manually added orders in the order list.
|
|
|
* @return number of manual orders in the chain.
|
|
|
*/
|
|
|
inline VehicleOrderID GetNumManualOrders() const { return this->num_manual_orders; }
|
|
|
|
|
|
StationID GetNextStoppingStation(const Vehicle *v) const;
|
|
|
const Order *GetNextStoppingOrder(const Vehicle *v, const Order *next, uint hops) const;
|
|
|
|
|
|
void InsertOrderAt(Order *new_order, int index);
|
|
|
void DeleteOrderAt(int index);
|
|
|
void MoveOrder(int from, int to);
|
|
|
|
|
|
/**
|
|
|
* Is this a shared order list?
|