summaryrefslogtreecommitdiff
path: root/src/order_base.h
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-05-31 22:26:44 +0200
committerGitHub <noreply@github.com>2021-05-31 22:26:44 +0200
commit9fff00ba205260ee5e11b50f87a3edee9b7e76a3 (patch)
tree2c6ee1eb6f0df2539c9ed17a2ae05541518a7dc9 /src/order_base.h
parent956d761e3ef1968c6470a9e78597c5531ed7c332 (diff)
downloadopenttd-9fff00ba205260ee5e11b50f87a3edee9b7e76a3.tar.xz
Codechange: C++-ify lists for SaveLoad (#9323)
Basically, this changes "SaveLoad *" to either: 1) "SaveLoadTable" if a list of SaveLoads was meant 2) "SaveLoad &" if a single entry was meant As added bonus, this removes SL_END / SLE_END / SLEG_END. This also adds core/span.hpp, a "std::span"-lite.
Diffstat (limited to 'src/order_base.h')
-rw-r--r--src/order_base.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/order_base.h b/src/order_base.h
index 923e67d42..c510bd3e0 100644
--- a/src/order_base.h
+++ b/src/order_base.h
@@ -18,6 +18,7 @@
#include "station_type.h"
#include "vehicle_type.h"
#include "date_type.h"
+#include "saveload/saveload.h"
typedef Pool<Order, OrderID, 256, 0xFF0000> OrderPool;
typedef Pool<OrderList, OrderListID, 128, 64000> OrderListPool;
@@ -31,9 +32,9 @@ extern OrderListPool _orderlist_pool;
*/
struct Order : OrderPool::PoolItem<&_order_pool> {
private:
- friend const struct SaveLoad *GetVehicleDescription(VehicleType vt); ///< Saving and loading the current order of vehicles.
+ friend SaveLoadTable GetVehicleDescription(VehicleType vt); ///< Saving and loading the current order of vehicles.
friend void Load_VEHS(); ///< Loading of ancient vehicles.
- friend const struct SaveLoad *GetOrderDescription(); ///< Saving and loading of orders.
+ friend SaveLoadTable GetOrderDescription(); ///< Saving and loading of orders.
uint8 type; ///< The type of order + non-stop flags
uint8 flags; ///< Load/unload types, depot order/action types.
@@ -250,7 +251,7 @@ void DeleteOrder(Vehicle *v, VehicleOrderID sel_ord);
struct OrderList : OrderListPool::PoolItem<&_orderlist_pool> {
private:
friend void AfterLoadVehicles(bool part_of_load); ///< For instantiating the shared vehicle chain
- friend const struct SaveLoad *GetOrderListDescription(); ///< Saving and loading of order lists.
+ friend SaveLoadTable GetOrderListDescription(); ///< Saving and loading of order lists.
StationID GetBestLoadableNext(const Vehicle *v, const Order *o1, const Order *o2) const;