summaryrefslogtreecommitdiff
path: root/src/order_base.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-05-19 14:22:04 +0000
committerrubidium <rubidium@openttd.org>2013-05-19 14:22:04 +0000
commit39474532777a1f7beadfd940abf29292bc39879a (patch)
tree59165ada9556ce5b154ec31cbb994827e7e90fe6 /src/order_base.h
parent0cc3d8df4b79628c702ba1293cdc00c099dd0b60 (diff)
downloadopenttd-39474532777a1f7beadfd940abf29292bc39879a.tar.xz
(svn r25259) -Codechange: track capacities and usage of links
Diffstat (limited to 'src/order_base.h')
-rw-r--r--src/order_base.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/order_base.h b/src/order_base.h
index 5054a315b..d361ce67d 100644
--- a/src/order_base.h
+++ b/src/order_base.h
@@ -168,6 +168,9 @@ public:
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. */
@@ -239,6 +242,14 @@ public:
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.
*/
@@ -250,6 +261,9 @@ public:
*/
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);