summaryrefslogtreecommitdiff
path: root/src/vehicle_base.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-05-23 12:27:42 +0000
committerrubidium <rubidium@openttd.org>2009-05-23 12:27:42 +0000
commit86710c5185b43fc989c4a7536300b1752c3c4d16 (patch)
treec36413353346b181fe288488c73afe8a6de5563c /src/vehicle_base.h
parentf490394aa8d78f4118e73beccc724cbad3b44854 (diff)
downloadopenttd-86710c5185b43fc989c4a7536300b1752c3c4d16.tar.xz
(svn r16397) -Codechange: move GetVehicleOrder/GetLastVehicleOrder into Vehicle
Diffstat (limited to 'src/vehicle_base.h')
-rw-r--r--src/vehicle_base.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/vehicle_base.h b/src/vehicle_base.h
index 350b5e7c5..8883470ab 100644
--- a/src/vehicle_base.h
+++ b/src/vehicle_base.h
@@ -470,6 +470,25 @@ public:
if (this->cur_order_index >= this->GetNumOrders()) this->cur_order_index = 0;
InvalidateVehicleOrder(this, 0);
}
+
+ /**
+ * Returns order 'index' of a vehicle or NULL when it doesn't exists
+ * @param index the order to fetch
+ * @return the found (or not) order
+ */
+ inline Order *GetOrder(int index) const
+ {
+ return (this->orders.list == NULL) ? NULL : this->orders.list->GetOrderAt(index);
+ }
+
+ /**
+ * Returns the last order of a vehicle, or NULL if it doesn't exists
+ * @return last order of a vehicle, if available
+ */
+ inline Order *GetLastOrder() const
+ {
+ return (this->orders.list == NULL) ? NULL : this->orders.list->GetLastOrder();
+ }
};
/**
@@ -520,16 +539,6 @@ struct FreeUnitIDGenerator {
~FreeUnitIDGenerator() { free(this->cache); }
};
-/* Returns order 'index' of a vehicle or NULL when it doesn't exists */
-static inline Order *GetVehicleOrder(const Vehicle *v, int index) { return (v->orders.list == NULL) ? NULL : v->orders.list->GetOrderAt(index); }
-
-/**
- * Returns the last order of a vehicle, or NULL if it doesn't exists
- * @param v Vehicle to query
- * @return last order of a vehicle, if available
- */
-static inline Order *GetLastVehicleOrder(const Vehicle *v) { return (v->orders.list == NULL) ? NULL : v->orders.list->GetLastOrder(); }
-
void CheckVehicle32Day(Vehicle *v);
static const int32 INVALID_COORD = 0x7fffffff;