OpenTTD Source: BaseConsist Struct Reference

OpenTTD Source 15.0-RC2

Public Member Functions | Data Fields
BaseConsist Struct Reference

Various front vehicle properties that are preserved when autoreplacing, using order-backup or switching front engines within a consist. More...

`#include <base_consist.h>`

Inheritance diagram for BaseConsist:

## 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 = 0
| The interval for (automatic) servicing; either in days or %.
VehicleOrderID | cur_real_order_index = 0
| The index to the current real (non-implicit) order.
VehicleOrderID | cur_implicit_order_index = 0
| The index to the current implicit order.
VehicleFlags | vehicle_flags {}
| Used for gradual loading and other miscellaneous things (.

## Detailed Description

Various front vehicle properties that are preserved when autoreplacing, using order-backup or switching front engines within a consist.

Definition at line 33 of file base_consist.h.

## Member Function Documentation

## ◆ CopyConsistPropertiesFrom()

void BaseConsist::CopyConsistPropertiesFrom | ( | const BaseConsist * | src | ) |

Copy properties of other BaseConsist.

Parameters

  src | Source for copying

Definition at line 22 of file base_consist.cpp.

References AutofillPreserveWaitTime, AutofillTimetable, cur_implicit_order_index, cur_real_order_index, current_order_time, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Flip(), lateness_counter, name, service_interval, ServiceIntervalIsCustom, ServiceIntervalIsPercent, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), timetable_start, TimetableStarted, and vehicle_flags.

Referenced by Vehicle::CopyVehicleConfigAndStatistics(), OrderBackup::DoRestore(), and OrderBackup::OrderBackup().

## ◆ ResetDepotUnbunching()

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(), InsertOrder(), and VehicleEnterDepot().

## Field Documentation

## ◆ cur_implicit_order_index

VehicleOrderID BaseConsist::cur_implicit_order_index = 0

The index to the current implicit order.

Definition at line 48 of file base_consist.h.

Referenced by CmdMoveOrder(), CmdSkipToOrder(), CopyConsistPropertiesFrom(), DeleteOrder(), DeleteVehicleOrders(), OrderBackup::DoRestore(), DrawOrderString(), OrderList::GetNextStoppingStation(), Vehicle::IncrementImplicitOrderIndex(), Vehicle::IncrementRealOrderIndex(), InsertOrder(), OrdersWindow::OrderClick_Skip(), PreviousOrderIsUnbunching(), ProcessOrders(), LinkRefresher::Run(), and UpdateOrderDest().

## ◆ cur_real_order_index

VehicleOrderID BaseConsist::cur_real_order_index = 0

The index to the current real (non-implicit) order.

Definition at line 47 of file base_consist.h.

Referenced by TimetableWindow::BuildArrivalDepartureList(), ChangeTimetable(), CmdModifyOrder(), CmdMoveOrder(), CmdSkipToOrder(), CopyConsistPropertiesFrom(), DeleteOrder(), 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().

## ◆ current_order_time

TimerGameTick::Ticks BaseConsist::current_order_time {}

How many ticks have passed since this order started.

Definition at line 37 of file base_consist.h.

Referenced by TimetableWindow::BuildArrivalDepartureList(), CopyConsistPropertiesFrom(), LoadUnloadVehicle(), Aircraft::Tick(), Train::Tick(), UpdateOrderDest(), UpdateVehicleTimetable(), and VehicleTimetableSorter().

## ◆ depot_unbunching_last_departure

TimerGameTick::TickCounter BaseConsist::depot_unbunching_last_departure {}

When the vehicle last left its unbunching depot.

Definition at line 41 of file base_consist.h.

Referenced by ResetDepotUnbunching(), and VehicleEnterDepot().

## ◆ depot_unbunching_next_departure

TimerGameTick::TickCounter BaseConsist::depot_unbunching_next_departure {}

When the vehicle will next try to leave its unbunching depot.

Definition at line 42 of file base_consist.h.

Referenced by Vehicle::LeaveUnbunchingDepot(), and ResetDepotUnbunching().

## ◆ lateness_counter

TimerGameTick::Ticks BaseConsist::lateness_counter {}

How many ticks late (or early if negative) this vehicle is.

Definition at line 38 of file base_consist.h.

Referenced by TimetableWindow::BuildArrivalDepartureList(), CmdAutofillTimetable(), CmdSetVehicleOnTime(), CopyConsistPropertiesFrom(), TimetableWindow::DrawArrivalDeparturePanel(), TimetableWindow::DrawSummaryPanel(), LoadUnloadVehicle(), UpdateVehicleTimetable(), and VehicleTimetableDelaySorter().

## ◆ name

std::string BaseConsist::name {}

Name of vehicle.

Definition at line 34 of file base_consist.h.

Referenced by CloneVehicleName(), CmdBuildAircraft(), CmdCloneVehicle(), CmdMoveRailVehicle(), CmdRenameVehicle(), CopyConsistPropertiesFrom(), OrderBackup::DoRestore(), BaseVehicleListWindow::DrawVehicleListItems(), and FormatString().

## ◆ round_trip_time

TimerGameTick::Ticks BaseConsist::round_trip_time

How many ticks for a single circumnavigation of the orders.

Definition at line 43 of file base_consist.h.

Referenced by Vehicle::LeaveUnbunchingDepot(), ResetDepotUnbunching(), and VehicleEnterDepot().

## ◆ service_interval

uint16_t BaseConsist::service_interval = 0

The interval for (automatic) servicing; either in days or %.

Definition at line 45 of file base_consist.h.

Referenced by CmdCloneVehicle(), and CopyConsistPropertiesFrom().

## ◆ timetable_start

TimerGameTick::TickCounter BaseConsist::timetable_start {}

At what tick of TimerGameTick::counter the vehicle should start its timetable.

Definition at line 39 of file base_consist.h.

Referenced by CmdAutofillTimetable(), CopyConsistPropertiesFrom(), TimetableWindow::DrawSummaryPanel(), and UpdateVehicleTimetable().

## ◆ vehicle_flags

VehicleFlags BaseConsist::vehicle_flags {}

Used for gradual loading and other miscellaneous things (.

See also
  VehicleFlags enum)

Definition at line 50 of file base_consist.h.

Referenced by TimetableWindow::BuildArrivalDepartureList(), CalcPercentVehicleFilled(), CmdAutofillTimetable(), CmdBuildAircraft(), CmdBuildRailVehicle(), CmdSetVehicleOnTime(), CopyConsistPropertiesFrom(), TimetableWindow::DrawArrivalDeparturePanel(), TimetableWindow::DrawSummaryPanel(), BaseVehicleListWindow::DrawVehicleListItems(), VehicleViewWindow::DrawWidget(), LoadUnloadVehicle(), TimetableWindow::OnClick(), TimetableWindow::OnPaint(), PrepareUnload(), and UpdateVehicleTimetable().

The documentation for this struct was generated from the following files:

- src/base_consist.h
- src/base_consist.cpp