2012-07-29 16:44:39 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** @file base_consist.h Properties for front vehicles/consists. */
|
|
|
|
|
|
|
|
#ifndef BASE_CONSIST_H
|
|
|
|
#define BASE_CONSIST_H
|
|
|
|
|
|
|
|
#include "order_type.h"
|
|
|
|
#include "date_type.h"
|
2015-08-01 18:47:09 +00:00
|
|
|
#include "timetable.h"
|
2020-05-21 22:50:48 +00:00
|
|
|
#include "core/tinystring_type.hpp"
|
2012-07-29 16:44:39 +00:00
|
|
|
|
|
|
|
/** Various front vehicle properties that are preserved when autoreplacing, using order-backup or switching front engines within a consist. */
|
|
|
|
struct BaseConsist {
|
2020-05-21 22:50:48 +00:00
|
|
|
TinyString name; ///< Name of vehicle
|
2012-07-29 16:48:00 +00:00
|
|
|
|
|
|
|
/* Used for timetabling. */
|
|
|
|
uint32 current_order_time; ///< How many ticks have passed since this order started.
|
|
|
|
int32 lateness_counter; ///< How many ticks late (or early if negative) this vehicle is.
|
2015-08-01 18:47:09 +00:00
|
|
|
DateTicks timetable_start; ///< When the vehicle is supposed to start the timetable.
|
2016-05-11 20:31:31 +00:00
|
|
|
uint16 timetable_start_subticks; ///< When the vehicle is supposed to start the timetable: sub-ticks.
|
2012-07-29 16:48:00 +00:00
|
|
|
|
2013-02-14 17:24:55 +00:00
|
|
|
uint16 service_interval; ///< The interval for (automatic) servicing; either in days or %.
|
2012-07-29 16:48:00 +00:00
|
|
|
|
2012-07-29 16:44:39 +00:00
|
|
|
VehicleOrderID cur_real_order_index;///< The index to the current real (non-implicit) order
|
2012-07-29 16:48:00 +00:00
|
|
|
VehicleOrderID cur_implicit_order_index;///< The index to the current implicit order
|
2017-12-18 01:26:27 +00:00
|
|
|
VehicleOrderID cur_timetable_order_index;///< The index to the current real (non-implicit) order used for timetable updates
|
2012-07-29 16:48:00 +00:00
|
|
|
|
2022-01-18 18:51:24 +00:00
|
|
|
uint32 vehicle_flags; ///< Used for gradual loading and other miscellaneous things (@see VehicleFlags enum)
|
2012-07-29 16:44:39 +00:00
|
|
|
|
2023-05-14 21:31:03 +00:00
|
|
|
virtual ~BaseConsist() = default;
|
2012-07-29 16:45:11 +00:00
|
|
|
|
2012-07-29 16:44:39 +00:00
|
|
|
void CopyConsistPropertiesFrom(const BaseConsist *src);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* BASE_CONSIST_H */
|