OpenTTD Source 20241224-master-gf74b0cf984
|
Various front vehicle properties that are preserved when autoreplacing, using order-backup or switching front engines within a consist. More...
#include <base_consist.h>
Public Member Functions | |
void | CopyConsistPropertiesFrom (const BaseConsist *src) |
Copy properties of other BaseConsist. | |
void | ResetDepotUnbunching () |
Resets all the data used for depot unbunching. | |
Data Fields | |
std::string | name |
Name of vehicle. | |
TimerGameTick::Ticks | current_order_time |
How many ticks have passed since this order started. | |
TimerGameTick::Ticks | lateness_counter |
How many ticks late (or early if negative) this vehicle is. | |
TimerGameTick::TickCounter | timetable_start |
At what tick of TimerGameTick::counter the vehicle should start its timetable. | |
TimerGameTick::TickCounter | depot_unbunching_last_departure |
When the vehicle last left its unbunching depot. | |
TimerGameTick::TickCounter | depot_unbunching_next_departure |
When the vehicle will next try to leave its unbunching depot. | |
TimerGameTick::Ticks | round_trip_time |
How many ticks for a single circumnavigation of the orders. | |
uint16_t | service_interval |
The interval for (automatic) servicing; either in days or %. | |
VehicleOrderID | cur_real_order_index |
The index to the current real (non-implicit) order. | |
VehicleOrderID | cur_implicit_order_index |
The index to the current implicit order. | |
uint16_t | vehicle_flags |
Used for gradual loading and other miscellaneous things (. | |
Various front vehicle properties that are preserved when autoreplacing, using order-backup or switching front engines within a consist.
Definition at line 17 of file base_consist.h.
void BaseConsist::CopyConsistPropertiesFrom | ( | const BaseConsist * | src | ) |
Copy properties of other BaseConsist.
src | Source for copying |
Definition at line 22 of file base_consist.cpp.
References cur_implicit_order_index, cur_real_order_index, current_order_time, HasBit(), lateness_counter, name, service_interval, SetBit(), timetable_start, ToggleBit(), vehicle_flags, VF_AUTOFILL_PRES_WAIT_TIME, VF_AUTOFILL_TIMETABLE, VF_SERVINT_IS_CUSTOM, VF_SERVINT_IS_PERCENT, and VF_TIMETABLE_STARTED.
Referenced by Vehicle::CopyVehicleConfigAndStatistics(), OrderBackup::DoRestore(), and OrderBackup::OrderBackup().
void BaseConsist::ResetDepotUnbunching | ( | ) |
Resets all the data used for depot unbunching.
Definition at line 49 of file base_consist.cpp.
References depot_unbunching_last_departure, depot_unbunching_next_departure, and round_trip_time.
Referenced by CmdChangeTimetable(), CmdForceTrainProceed(), CmdModifyOrder(), CmdMoveOrder(), CmdReverseTrainDirection(), CmdSetTimetableStart(), CmdSetVehicleOnTime(), CmdSkipToOrder(), CmdStartStopVehicle(), CmdTurnRoadVeh(), DeleteOrder(), DeleteVehicleOrders(), Vehicle::HandlePathfindingResult(), InsertOrder(), Vehicle::SendToDepot(), and VehicleEnterDepot().
VehicleOrderID BaseConsist::cur_implicit_order_index |
The index to the current implicit order.
Definition at line 32 of file base_consist.h.
Referenced by Vehicle::BeginLoading(), CmdMoveOrder(), CmdSkipToOrder(), CopyConsistPropertiesFrom(), DeleteOrder(), Vehicle::DeleteUnreachedImplicitOrders(), DeleteVehicleOrders(), OrderBackup::DoRestore(), DrawOrderString(), OrderList::GetNextStoppingStation(), Vehicle::HandleLoading(), Vehicle::IncrementImplicitOrderIndex(), Vehicle::IncrementRealOrderIndex(), InsertOrder(), OrdersWindow::OrderClick_Skip(), PreviousOrderIsUnbunching(), ProcessOrders(), LinkRefresher::Run(), and UpdateOrderDest().
VehicleOrderID BaseConsist::cur_real_order_index |
The index to the current real (non-implicit) order.
Definition at line 31 of file base_consist.h.
Referenced by Vehicle::BeginLoading(), TimetableWindow::BuildArrivalDepartureList(), ChangeTimetable(), CmdModifyOrder(), CmdMoveOrder(), CmdSkipToOrder(), CopyConsistPropertiesFrom(), DeleteOrder(), Vehicle::DeleteUnreachedImplicitOrders(), DeleteVehicleOrders(), OrderBackup::DoRestore(), TimetableWindow::DrawArrivalDeparturePanel(), DrawOrderString(), BaseVehicleListWindow::DrawVehicleListItems(), Vehicle::IncrementImplicitOrderIndex(), Vehicle::IncrementRealOrderIndex(), InsertOrder(), ProcessOrders(), Vehicle::SkipToNextRealOrderIndex(), VehicleOrderSaver::SwitchToNextOrder(), UpdateOrderDest(), Vehicle::UpdateRealOrderIndex(), UpdateVehicleTimetable(), VehicleEnterDepot(), and VehicleTimetableSorter().
TimerGameTick::Ticks BaseConsist::current_order_time |
How many ticks have passed since this order started.
Definition at line 21 of file base_consist.h.
Referenced by TimetableWindow::BuildArrivalDepartureList(), CopyConsistPropertiesFrom(), Vehicle::HandleLoading(), LoadUnloadVehicle(), Aircraft::Tick(), Train::Tick(), UpdateOrderDest(), UpdateVehicleTimetable(), and VehicleTimetableSorter().
TimerGameTick::TickCounter BaseConsist::depot_unbunching_last_departure |
When the vehicle last left its unbunching depot.
Definition at line 25 of file base_consist.h.
Referenced by Vehicle::LeaveUnbunchingDepot(), ResetDepotUnbunching(), and VehicleEnterDepot().
TimerGameTick::TickCounter BaseConsist::depot_unbunching_next_departure |
When the vehicle will next try to leave its unbunching depot.
Definition at line 26 of file base_consist.h.
Referenced by Vehicle::IsWaitingForUnbunching(), Vehicle::LeaveUnbunchingDepot(), and ResetDepotUnbunching().
TimerGameTick::Ticks BaseConsist::lateness_counter |
How many ticks late (or early if negative) this vehicle is.
Definition at line 22 of file base_consist.h.
Referenced by TimetableWindow::BuildArrivalDepartureList(), CmdAutofillTimetable(), CmdSetVehicleOnTime(), CopyConsistPropertiesFrom(), TimetableWindow::DrawArrivalDeparturePanel(), TimetableWindow::DrawSummaryPanel(), Vehicle::LeaveUnbunchingDepot(), LoadUnloadVehicle(), UpdateVehicleTimetable(), and VehicleTimetableDelaySorter().
std::string BaseConsist::name |
Name of vehicle.
Definition at line 18 of file base_consist.h.
Referenced by CloneVehicleName(), CmdBuildAircraft(), CmdCloneVehicle(), CmdMoveRailVehicle(), CmdRenameVehicle(), CopyConsistPropertiesFrom(), OrderBackup::DoRestore(), BaseVehicleListWindow::DrawVehicleListItems(), and FormatString().
TimerGameTick::Ticks BaseConsist::round_trip_time |
How many ticks for a single circumnavigation of the orders.
Definition at line 27 of file base_consist.h.
Referenced by Vehicle::LeaveUnbunchingDepot(), ResetDepotUnbunching(), and VehicleEnterDepot().
uint16_t BaseConsist::service_interval |
The interval for (automatic) servicing; either in days or %.
Definition at line 29 of file base_consist.h.
Referenced by CmdCloneVehicle(), and CopyConsistPropertiesFrom().
TimerGameTick::TickCounter BaseConsist::timetable_start |
At what tick of TimerGameTick::counter the vehicle should start its timetable.
Definition at line 23 of file base_consist.h.
Referenced by CmdAutofillTimetable(), CopyConsistPropertiesFrom(), TimetableWindow::DrawSummaryPanel(), and UpdateVehicleTimetable().
uint16_t BaseConsist::vehicle_flags |
Used for gradual loading and other miscellaneous things (.
Definition at line 34 of file base_consist.h.
Referenced by TimetableWindow::BuildArrivalDepartureList(), CalcPercentVehicleFilled(), CmdAutofillTimetable(), CmdBuildAircraft(), CmdBuildRailVehicle(), CmdBuildRoadVehicle(), CmdBuildShip(), CmdSetVehicleOnTime(), CopyConsistPropertiesFrom(), TimetableWindow::DrawArrivalDeparturePanel(), TimetableWindow::DrawSummaryPanel(), BaseVehicleListWindow::DrawVehicleListItems(), VehicleViewWindow::DrawWidget(), Vehicle::HandleLoading(), Vehicle::HandlePathfindingResult(), LoadUnloadVehicle(), TimetableWindow::OnClick(), TimetableWindow::OnPaint(), PrepareUnload(), and UpdateVehicleTimetable().