diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-11-02 22:58:40 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-12-16 22:28:32 +0100 |
commit | 211c630cbe4185a2adf8b8cd8f52ca58f8bf17ed (patch) | |
tree | 89290b522a2852d71e9a71c43b6d581fb8d1d36d /src/order_base.h | |
parent | de45a8729c0f1ab965e4adf4e6ad7095a4a678c8 (diff) | |
download | openttd-211c630cbe4185a2adf8b8cd8f52ca58f8bf17ed.tar.xz |
Codechange: Un-bitstuff order commands.
Diffstat (limited to 'src/order_base.h')
-rw-r--r-- | src/order_base.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/order_base.h b/src/order_base.h index a722ef5d4..836ceb4b0 100644 --- a/src/order_base.h +++ b/src/order_base.h @@ -25,6 +25,9 @@ typedef Pool<OrderList, OrderListID, 128, 64000> OrderListPool; extern OrderPool _order_pool; extern OrderListPool _orderlist_pool; +template <typename, typename> +class EndianBufferWriter; + /* If you change this, keep in mind that it is saved on 3 places: * - Load_ORDR, all the global orders * - Vehicle -> current_order @@ -38,6 +41,10 @@ private: friend class SlVehicleCommon; friend class SlVehicleDisaster; + template <typename Tcont, typename Titer> + friend EndianBufferWriter<Tcont, Titer> &operator <<(EndianBufferWriter<Tcont, Titer> &buffer, const Order &data); + friend class EndianBufferReader &operator >>(class EndianBufferReader &buffer, Order &order); + uint8 type; ///< The type of order + non-stop flags uint8 flags; ///< Load/unload types, depot order/action types. DestinationID dest; ///< The destination of the order. @@ -51,7 +58,7 @@ private: public: Order *next; ///< Pointer to next order. If nullptr, end of list - Order() : flags(0), refit_cargo(CT_NO_REFIT), max_speed(UINT16_MAX) {} + Order() : flags(0), refit_cargo(CT_NO_REFIT), wait_time(0), travel_time(0), max_speed(UINT16_MAX) {} ~Order(); Order(uint32 packed); |