2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 /** @file base_consist.h Properties for front vehicles/consists. */
10 #ifndef BASE_CONSIST_H
11 #define BASE_CONSIST_H
13 #include "order_type.h"
14 #include "timer/timer_game_tick.h"
16 /** Various front vehicle properties that are preserved when autoreplacing, using order-backup or switching front engines within a consist. */
18 std::string name
; ///< Name of vehicle
20 /* Used for timetabling. */
21 TimerGameTick::Ticks current_order_time
; ///< How many ticks have passed since this order started.
22 TimerGameTick::Ticks lateness_counter
; ///< How many ticks late (or early if negative) this vehicle is.
23 TimerGameTick::TickCounter timetable_start
; ///< At what tick of TimerGameTick::counter the vehicle should start its timetable.
25 TimerGameTick::TickCounter depot_unbunching_last_departure
; ///< When the vehicle last left its unbunching depot.
26 TimerGameTick::TickCounter depot_unbunching_next_departure
; ///< When the vehicle will next try to leave its unbunching depot.
27 TimerGameTick::Ticks round_trip_time
; ///< How many ticks for a single circumnavigation of the orders.
29 uint16_t service_interval
; ///< The interval for (automatic) servicing; either in days or %.
31 VehicleOrderID cur_real_order_index
;///< The index to the current real (non-implicit) order
32 VehicleOrderID cur_implicit_order_index
;///< The index to the current implicit order
34 uint16_t vehicle_flags
; ///< Used for gradual loading and other miscellaneous things (@see VehicleFlags enum)
36 virtual ~BaseConsist() = default;
38 void CopyConsistPropertiesFrom(const BaseConsist
*src
);
39 void ResetDepotUnbunching();
42 #endif /* BASE_CONSIST_H */