OpenTTD Source 20241224-master-gee860a5c8e
|
Public Member Functions | |
Order (uint8_t type, uint8_t flags, DestinationID dest) | |
~Order () | |
Clean everything up. | |
bool | IsType (OrderType type) const |
Check whether this order is of the given type. | |
OrderType | GetType () const |
Get the type of order of this order. | |
void | Free () |
'Free' the order | |
void | MakeGoToStation (StationID destination) |
Makes this order a Go To Station order. | |
void | MakeGoToDepot (DepotID destination, OrderDepotTypeFlags order, OrderNonStopFlags non_stop_type=ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS, OrderDepotActionFlags action=ODATF_SERVICE_ONLY, CargoID cargo=CARGO_NO_REFIT) |
Makes this order a Go To Depot order. | |
void | MakeGoToWaypoint (StationID destination) |
Makes this order a Go To Waypoint order. | |
void | MakeLoading (bool ordered) |
Makes this order a Loading order. | |
void | MakeLeaveStation () |
Makes this order a Leave Station order. | |
void | MakeDummy () |
Makes this order a Dummy order. | |
void | MakeConditional (VehicleOrderID order) |
Makes this order an conditional order. | |
void | MakeImplicit (StationID destination) |
Makes this order an implicit order. | |
bool | IsGotoOrder () const |
Is this a 'goto' order with a real destination? | |
DestinationID | GetDestination () const |
Gets the destination of this order. | |
void | SetDestination (DestinationID destination) |
Sets the destination of this order. | |
bool | IsRefit () const |
Is this order a refit order. | |
bool | IsAutoRefit () const |
Is this order a auto-refit order. | |
CargoID | GetRefitCargo () const |
Get the cargo to to refit to. | |
void | SetRefit (CargoID cargo) |
Make this depot/station order also a refit order. | |
OrderLoadFlags | GetLoadType () const |
How must the consist be loaded? | |
OrderUnloadFlags | GetUnloadType () const |
How must the consist be unloaded? | |
OrderNonStopFlags | GetNonStopType () const |
At which stations must we stop? | |
OrderStopLocation | GetStopLocation () const |
Where must we stop at the platform? | |
OrderDepotTypeFlags | GetDepotOrderType () const |
What caused us going to the depot? | |
OrderDepotActionFlags | GetDepotActionType () const |
What are we going to do when in the depot. | |
OrderConditionVariable | GetConditionVariable () const |
What variable do we have to compare? | |
OrderConditionComparator | GetConditionComparator () const |
What is the comparator to use? | |
VehicleOrderID | GetConditionSkipToOrder () const |
Get the order to skip to. | |
uint16_t | GetConditionValue () const |
Get the value to base the skip on. | |
void | SetLoadType (OrderLoadFlags load_type) |
Set how the consist must be loaded. | |
void | SetUnloadType (OrderUnloadFlags unload_type) |
Set how the consist must be unloaded. | |
void | SetNonStopType (OrderNonStopFlags non_stop_type) |
Set whether we must stop at stations or not. | |
void | SetStopLocation (OrderStopLocation stop_location) |
Set where we must stop at the platform. | |
void | SetDepotOrderType (OrderDepotTypeFlags depot_order_type) |
Set the cause to go to the depot. | |
void | SetDepotActionType (OrderDepotActionFlags depot_service_type) |
Set what we are going to do in the depot. | |
void | SetConditionVariable (OrderConditionVariable condition_variable) |
Set variable we have to compare. | |
void | SetConditionComparator (OrderConditionComparator condition_comparator) |
Set the comparator to use. | |
void | SetConditionSkipToOrder (VehicleOrderID order_id) |
Get the order to skip to. | |
void | SetConditionValue (uint16_t value) |
Set the value to base the skip on. | |
bool | IsWaitTimetabled () const |
Does this order have an explicit wait time set? | |
bool | IsTravelTimetabled () const |
Does this order have an explicit travel time set? | |
uint16_t | GetTimetabledWait () const |
Get the time in ticks a vehicle should wait at the destination or 0 if it's not timetabled. | |
uint16_t | GetTimetabledTravel () const |
Get the time in ticks a vehicle should take to reach the destination or 0 if it's not timetabled. | |
uint16_t | GetWaitTime () const |
Get the time in ticks a vehicle will probably wait at the destination (timetabled or not). | |
uint16_t | GetTravelTime () const |
Get the time in ticks a vehicle will probably take to reach the destination (timetabled or not). | |
uint16_t | GetMaxSpeed () const |
Get the maxmimum speed in km-ish/h a vehicle is allowed to reach on the way to the destination. | |
void | SetWaitTimetabled (bool timetabled) |
Set if the wait time is explicitly timetabled (unless the order is conditional). | |
void | SetTravelTimetabled (bool timetabled) |
Set if the travel time is explicitly timetabled (unless the order is conditional). | |
void | SetWaitTime (uint16_t time) |
Set the time in ticks to wait at the destination. | |
void | SetTravelTime (uint16_t time) |
Set the time in ticks to take for travelling to the destination. | |
void | SetMaxSpeed (uint16_t speed) |
Set the maxmimum speed in km-ish/h a vehicle is allowed to reach on the way to the destination. | |
bool | ShouldStopAtStation (const Vehicle *v, StationID station) const |
Check whether the given vehicle should stop at the given station based on this order and the non-stop settings. | |
bool | CanLoadOrUnload () const |
bool | CanLeaveWithCargo (bool has_cargo) const |
A vehicle can leave the current station with cargo if: | |
TileIndex | GetLocation (const Vehicle *v, bool airport=false) const |
Returns a tile somewhat representing the order destination (not suitable for pathfinding). | |
bool | IsCompletelyTimetabled () const |
Checks if travel_time and wait_time apply to this order and if they are timetabled. | |
void | AssignOrder (const Order &other) |
Assign data to an order (from another order) This function makes sure that the index is maintained correctly. | |
bool | Equals (const Order &other) const |
Does this order have the same type, flags and destination? | |
uint32_t | Pack () const |
Pack this order into a 32 bits integer, or actually only the type, flags and destination. | |
uint16_t | MapOldOrder () const |
Pack this order into a 16 bits integer as close to the TTD representation as possible. | |
void | ConvertFromOldSavegame () |
Converts this order from an old savegame's version; it moves all bits to the new location. | |
Public Member Functions inherited from Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_order_pool > | |
void * | operator new (size_t size) |
Allocates space for new Titem. | |
void * | operator new (size_t size, size_t index) |
Allocates space for new Titem with given index. | |
void * | operator new (size_t, void *ptr) |
Allocates space for new Titem at given memory address. | |
void | operator delete (void *p) |
Marks Titem as free. | |
Data Fields | |
Order * | next = nullptr |
Pointer to next order. If nullptr, end of list. | |
Data Fields inherited from Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_order_pool > | |
Tindex | index |
Index of this pool item. | |
Private Attributes | |
uint8_t | type = 0 |
The type of order + non-stop flags. | |
uint8_t | flags = 0 |
Load/unload types, depot order/action types. | |
DestinationID | dest = 0 |
The destination of the order. | |
CargoID | refit_cargo = CARGO_NO_REFIT |
Refit CargoID. | |
uint16_t | wait_time = 0 |
How long in ticks to wait at the destination. | |
uint16_t | travel_time = 0 |
How long in ticks the journey to this destination should take. | |
uint16_t | max_speed = UINT16_MAX |
How fast the vehicle may go on the way to the destination. | |
Friends | |
struct | VEHSChunkHandler |
Loading of ancient vehicles. | |
class | SlVehicleCommon |
class | SlVehicleDisaster |
SaveLoadTable | GetOrderDescription () |
Saving and loading of orders. | |
template<typename Tcont , typename Titer > | |
EndianBufferWriter< Tcont, Titer > & | operator<< (EndianBufferWriter< Tcont, Titer > &buffer, const Order &data) |
class EndianBufferReader & | operator>> (class EndianBufferReader &buffer, Order &order) |
Additional Inherited Members | |
Public Types inherited from Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_order_pool > | |
typedef struct Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero > | Pool |
Type of the pool this item is going to be part of. | |
Static Public Member Functions inherited from Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_order_pool > | |
static bool | CanAllocateItem (size_t n=1) |
Helper functions so we can use PoolItem::Function() instead of _poolitem_pool.Function() | |
static bool | CleaningPool () |
Returns current state of pool cleaning - yes or no. | |
static bool | IsValidID (size_t index) |
Tests whether given index can be used to get valid (non-nullptr) Titem. | |
static Titem * | Get (size_t index) |
Returns Titem with given index. | |
static Titem * | GetIfValid (size_t index) |
Returns Titem with given index. | |
static size_t | GetPoolSize () |
Returns first unused index. | |
static size_t | GetNumItems () |
Returns number of valid items in the pool. | |
static void | PostDestructor (size_t index) |
Dummy function called after destructor of each member. | |
static Pool::IterateWrapper< Titem > | Iterate (size_t from=0) |
Returns an iterable ensemble of all valid Titem. | |
Definition at line 36 of file order_base.h.
|
inline |
Definition at line 61 of file order_base.h.
|
inline |
Definition at line 62 of file order_base.h.
Order::~Order | ( | ) |
Clean everything up.
Definition at line 47 of file order_cmd.cpp.
References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_station_pool >::GetIfValid(), InvalidateWindowClassesData(), BaseStation::owner, OWNER_NONE, and WC_STATION_LIST.
void Order::AssignOrder | ( | const Order & | other | ) |
Assign data to an order (from another order) This function makes sure that the index is maintained correctly.
other | the data to copy (except next pointer). |
Definition at line 257 of file order_cmd.cpp.
References dest, flags, max_speed, refit_cargo, travel_time, type, and wait_time.
Referenced by CmdInsertOrder(), ORDRChunkHandler::Load(), and OrderBackup::OrderBackup().
bool Order::CanLeaveWithCargo | ( | bool | has_cargo | ) | const |
A vehicle can leave the current station with cargo if:
Definition at line 2249 of file order_cmd.cpp.
References GetLoadType(), GetUnloadType(), OLFB_NO_LOAD, OUFB_TRANSFER, and OUFB_UNLOAD.
Referenced by Vehicle::LeaveStation(), and LinkRefresher::RefreshLinks().
bool Order::CanLoadOrUnload | ( | ) | const |
Definition at line 2235 of file order_cmd.cpp.
void Order::ConvertFromOldSavegame | ( | ) |
Converts this order from an old savegame's version; it moves all bits to the new location.
Definition at line 26 of file order_sl.cpp.
References _savegame_type, _settings_client, flags, GetType(), ClientSettings::gui, IsSavegameVersionBefore(), IsType(), GUISettings::new_nonstop, ODATF_SERVICE_ONLY, ODATFB_HALT, ODTF_MANUAL, ODTFB_PART_OF_ORDERS, ODTFB_SERVICE, OLF_FULL_LOAD_ANY, OLF_LOAD_IF_POSSIBLE, OLFB_FULL_LOAD, OLFB_NO_LOAD, ONSF_NO_STOP_AT_ANY_STATION, ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS, ONSF_STOP_EVERYWHERE, OSL_PLATFORM_FAR_END, OUF_UNLOAD_IF_POSSIBLE, OUFB_TRANSFER, OUFB_UNLOAD, SetDepotActionType(), SetDepotOrderType(), SetLoadType(), SetNonStopType(), SetStopLocation(), SetUnloadType(), GUISettings::sg_full_load_any, GUISettings::sg_new_nonstop, SGT_TTD, SGT_TTO, and SLV_22.
bool Order::Equals | ( | const Order & | other | ) | const |
Does this order have the same type, flags and destination?
other | the second order to compare to. |
Definition at line 175 of file order_cmd.cpp.
References dest, flags, GetDepotActionType(), GetDepotOrderType(), IsType(), ODATFB_NEAREST_DEPOT, and type.
Referenced by ChangeTimetable(), CheckOrders(), ProcessOrders(), and VehiclesHaveSameOrderList().
void Order::Free | ( | ) |
'Free' the order
Definition at line 63 of file order_cmd.cpp.
References dest, flags, next, and type.
Referenced by AircraftEventHandler_AtTerminal(), AircraftEventHandler_InHangar(), GetOrderCmdFromTile(), ProcessOrders(), and UpdateOrderDest().
|
inline |
What is the comparator to use?
Definition at line 150 of file order_base.h.
References GB().
Referenced by CmdInsertOrder(), CmdModifyOrder(), DrawOrderString(), and ProcessConditionalOrder().
|
inline |
Get the order to skip to.
Definition at line 152 of file order_base.h.
References flags.
Referenced by CmdInsertOrder(), DrawOrderString(), OrderList::GetNextDecisionNode(), OrderList::GetNextStoppingStation(), GetOrderDistance(), LinkRefresher::PredictNextOrder(), and ProcessConditionalOrder().
|
inline |
Get the value to base the skip on.
Definition at line 154 of file order_base.h.
References GB().
Referenced by CmdInsertOrder(), CmdModifyOrder(), DrawOrderString(), OrdersWindow::OnClick(), ProcessConditionalOrder(), and OrdersWindow::SetStringParameters().
|
inline |
What variable do we have to compare?
Definition at line 148 of file order_base.h.
References GB().
Referenced by CmdInsertOrder(), CmdModifyOrder(), DrawOrderString(), OrderList::GetNextDecisionNode(), OrdersWindow::OnClick(), OrdersWindow::OnQueryTextFinished(), ProcessConditionalOrder(), and OrdersWindow::SetStringParameters().
|
inline |
What are we going to do when in the depot.
Definition at line 146 of file order_base.h.
References GB().
Referenced by CmdInsertOrder(), CmdModifyOrder(), CmdOrderRefit(), DrawOrderString(), VehicleViewWindow::DrawWidget(), Equals(), FindNearestHangar(), OrderList::GetNextDecisionNode(), PreviousOrderIsUnbunching(), Vehicle::SendToDepot(), OrdersWindow::SetStringParameters(), UpdateOrderDest(), and VehicleEnterDepot().
|
inline |
What caused us going to the depot?
Definition at line 144 of file order_base.h.
References GB().
Referenced by CmdInsertOrder(), CmdModifyOrder(), CmdOrderRefit(), DrawOrderString(), Equals(), MapOldOrder(), OrdersWindow::OrderClick_Service(), ProcessOrders(), Vehicle::SendToDepot(), OrdersWindow::SetStringParameters(), ShouldStopAtStation(), VehicleOrderSaver::SwitchToNextOrder(), UpdateAirplanesOnNewStation(), UpdateOrderDest(), and VehicleEnterDepot().
|
inline |
Gets the destination of this order.
Definition at line 103 of file order_base.h.
References dest.
Referenced by AircraftController(), AircraftEventHandler_AtTerminal(), AircraftEventHandler_InHangar(), AircraftNextAirportPos_and_Order(), Vehicle::BeginLoading(), CheckIfTrainNeedsService(), CheckNextTrainTile(), CmdInsertOrder(), DrawOrderString(), DrawSmallOrderList(), VehicleViewWindow::DrawWidget(), FindNearestHangar(), GetLocation(), OrderList::GetNextStoppingStation(), GetTrainStopLocation(), Vehicle::HandleLoading(), OrderList::InsertOrderAt(), MapOldOrder(), Train::OnNewEconomyDay(), OrderGoesToStation(), CYapfCostRailT< Types >::PfCalcCost(), ProcessOrders(), LinkRefresher::RefreshStats(), UpdateAirplanesOnNewStation(), UpdateOrderDest(), UpdateWaypointOrder(), UpdateWaypointOrder(), and VehicleEnterDepot().
|
inline |
How must the consist be loaded?
Definition at line 136 of file order_base.h.
References GB().
Referenced by Vehicle::BeginLoading(), CalcPercentVehicleFilled(), CancelLoadingDueToDeletedOrder(), CanLeaveWithCargo(), CmdInsertOrder(), CmdModifyOrder(), CmdOrderRefit(), DrawOrderString(), HandleStationRefit(), Vehicle::LeaveStation(), LoadUnloadVehicle(), MapOldOrder(), OrdersWindow::OnClick(), OrdersWindow::OrderClick_FullLoad(), and LinkRefresher::RefreshStats().
Returns a tile somewhat representing the order destination (not suitable for pathfinding).
v | The vehicle to get the location for. |
airport | Get the airport tile and not the station location for aircraft. |
Definition at line 642 of file order_cmd.cpp.
References Station::airport, SpecializedStation< Station, false >::Get(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_depot_pool >::Get(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_station_pool >::Get(), GetDestination(), GetType(), INVALID_TILE, OrthogonalTileArea::tile, BaseVehicle::type, VEH_AIRCRAFT, and BaseStation::xy.
Referenced by GetOrderDistance(), OrdersWindow::OnClick(), VehicleViewWindow::OnClick(), and VehicleViewWindow::OnPaint().
|
inline |
Get the maxmimum speed in km-ish/h a vehicle is allowed to reach on the way to the destination.
Definition at line 201 of file order_base.h.
References max_speed.
Referenced by CmdChangeTimetable(), CmdInsertOrder(), TimetableWindow::DrawTimetablePanel(), RoadVehicle::GetCurrentMaxSpeed(), Train::GetCurrentMaxSpeed(), TimetableWindow::OnClick(), CYapfCostRoadT< Types >::PfCalcCost(), CYapfCostRailT< Types >::PfCalcCost(), and ShipAccelerate().
|
inline |
At which stations must we stop?
Definition at line 140 of file order_base.h.
References GB().
Referenced by TimetableWindow::BuildArrivalDepartureList(), CanDetermineTimeTaken(), CmdChangeTimetable(), CmdInsertOrder(), CmdModifyOrder(), DrawOrderString(), IsCompletelyTimetabled(), Vehicle::LeaveStation(), MapOldOrder(), TimetableWindow::OnPaint(), OrdersWindow::OrderClick_Nonstop(), ProcessOrders(), ShouldStopAtStation(), and VehicleTimetableSorter().
|
inline |
Get the cargo to to refit to.
Definition at line 131 of file order_base.h.
References refit_cargo.
Referenced by CmdInsertOrder(), DrawOrderString(), GetIncompatibleRefitOrderIdForAutoreplace(), LoadUnloadVehicle(), LinkRefresher::RefreshLinks(), ReserveConsist(), and VehicleEnterDepot().
|
inline |
Where must we stop at the platform?
Definition at line 142 of file order_base.h.
References GB().
Referenced by CmdInsertOrder(), DrawOrderString(), and GetTrainStopLocation().
|
inline |
Get the time in ticks a vehicle should take to reach the destination or 0 if it's not timetabled.
Definition at line 190 of file order_base.h.
References IsTravelTimetabled(), and travel_time.
Referenced by ChangeTimetable(), OrderList::DeleteOrderAt(), TimetableWindow::DrawTimetablePanel(), FillTimetableArrivalDepartureTable(), OrderList::InsertOrderAt(), UpdateOrderDest(), and UpdateVehicleTimetable().
|
inline |
Get the time in ticks a vehicle should wait at the destination or 0 if it's not timetabled.
Definition at line 188 of file order_base.h.
References IsWaitTimetabled(), and wait_time.
Referenced by ChangeTimetable(), OrderList::DeleteOrderAt(), FillTimetableArrivalDepartureTable(), Vehicle::HandleLoading(), OrderList::InsertOrderAt(), LoadUnloadVehicle(), and UpdateVehicleTimetable().
|
inline |
Get the time in ticks a vehicle will probably take to reach the destination (timetabled or not).
Definition at line 194 of file order_base.h.
References travel_time.
Referenced by ChangeTimetable(), CmdChangeTimetable(), CmdInsertOrder(), OrderList::DeleteOrderAt(), TimetableWindow::DrawTimetablePanel(), OrderList::InsertOrderAt(), and TimetableWindow::OnClick().
|
inline |
Get the type of order of this order.
Definition at line 76 of file order_base.h.
References GB().
Referenced by AircraftEventHandler_AtTerminal(), CheckNextTrainTile(), CmdChangeTimetable(), CmdInsertOrder(), CmdModifyOrder(), ConvertFromOldSavegame(), DrawOrderString(), VehicleViewWindow::DrawWidget(), GetLocation(), Vehicle::HandleLoading(), IsType(), MapOldOrder(), ProcessConditionalOrder(), ProcessOrders(), ReverseTrainDirection(), VehicleOrderSaver::SwitchToNextOrder(), and UpdateOrderDest().
|
inline |
How must the consist be unloaded?
Definition at line 138 of file order_base.h.
References GB().
Referenced by CanLeaveWithCargo(), CmdInsertOrder(), CmdModifyOrder(), DrawOrderString(), OrderList::GetNextStoppingStation(), LoadUnloadVehicle(), MapOldOrder(), OrdersWindow::OnClick(), OrdersWindow::OrderClick_Unload(), and PrepareUnload().
|
inline |
Get the time in ticks a vehicle will probably wait at the destination (timetabled or not).
Definition at line 192 of file order_base.h.
References wait_time.
Referenced by ChangeTimetable(), CmdChangeTimetable(), CmdInsertOrder(), OrderList::DeleteOrderAt(), DrawOrderString(), OrderList::InsertOrderAt(), TimetableWindow::OnClick(), and UpdateVehicleTimetable().
|
inline |
Is this order a auto-refit order.
Definition at line 124 of file order_base.h.
References CARGO_AUTO_REFIT.
Referenced by DrawOrderString(), and LinkRefresher::RefreshLinks().
|
inline |
Checks if travel_time and wait_time apply to this order and if they are timetabled.
Definition at line 234 of file order_base.h.
References GetNonStopType(), IsTravelTimetabled(), IsType(), IsWaitTimetabled(), and ONSF_NO_STOP_AT_DESTINATION_STATION.
|
inline |
Is this a 'goto' order with a real destination?
Definition at line 93 of file order_base.h.
References IsType().
Referenced by DrawOrderString().
|
inline |
Is this order a refit order.
Definition at line 117 of file order_base.h.
References CARGO_AUTO_REFIT, and NUM_CARGO.
Referenced by DrawOrderString(), GetIncompatibleRefitOrderIdForAutoreplace(), OrderList::GetNextDecisionNode(), LoadUnloadVehicle(), LinkRefresher::RefreshLinks(), ReserveConsist(), and VehicleEnterDepot().
|
inline |
Does this order have an explicit travel time set?
Definition at line 185 of file order_base.h.
References HasBit(), and IsType().
Referenced by CanDetermineTimeTaken(), CmdChangeTimetable(), TimetableWindow::DrawTimetablePanel(), GetTimetabledTravel(), IsCompletelyTimetabled(), and UpdateVehicleTimetable().
|
inline |
Check whether this order is of the given type.
type | the type to check against. |
Definition at line 70 of file order_base.h.
References GetType(), and type.
Referenced by AfterLoadGame(), AircraftEntersTerminal(), AircraftEventHandler_AtTerminal(), AircraftEventHandler_InHangar(), AircraftNextAirportPos_and_Order(), Vehicle::BeginLoading(), TimetableWindow::BuildArrivalDepartureList(), CalcPercentVehicleFilled(), CancelLoadingDueToDeletedOrder(), CanDetermineTimeTaken(), CheckIfTrainNeedsService(), CheckTrainStayInDepot(), CmdBuildSingleSignal(), CmdBulkChangeTimetable(), CmdChangeTimetable(), CmdModifyOrder(), CmdOrderRefit(), CmdRefitVehicle(), CmdReverseTrainDirection(), CmdSkipToOrder(), CmdTurnRoadVeh(), ConvertFromOldSavegame(), DeleteOrder(), OrderList::DeleteOrderAt(), Vehicle::DeleteUnreachedImplicitOrders(), DeleteVehicleOrders(), DrawOrderString(), DrawSmallOrderList(), TimetableWindow::DrawTimetablePanel(), VehicleViewWindow::DrawWidget(), Equals(), FillTimetableArrivalDepartureTable(), FindNearestHangar(), OrderList::GetNextDecisionNode(), OrderList::GetNextStoppingStation(), GetOrderDistance(), GetTrainStopLocation(), Vehicle::HandleBreakdown(), Vehicle::HandleLoading(), OrderList::InsertOrderAt(), IsCompletelyTimetabled(), IsGotoOrder(), IsTravelTimetabled(), IsWaitTimetabled(), Vehicle::LeaveStation(), LoadUnloadVehicle(), MapAircraftMovementAction(), Vehicle::NeedsAutomaticServicing(), Train::OnNewEconomyDay(), TimetableWindow::OnPaint(), OrdersWindow::OnPlaceObject(), OrderGoesToStation(), CYapfCostRailT< Types >::PfCalcCost(), LinkRefresher::PredictNextOrder(), PreviousOrderIsUnbunching(), ProcessOrders(), LinkRefresher::RefreshLinks(), RemoveRoadStop(), VehicleResolverObject::ResolveReal(), Vehicle::SendToDepot(), OrdersWindow::SetStringParameters(), SetTravelTimetabled(), SetWaitTimetabled(), ShouldStopAtStation(), UnpackOldOrder(), UpdateAirplanesOnNewStation(), UpdateOldAircraft(), UpdateOrderDest(), UpdateVehicleTimetable(), UpdateWaypointOrder(), UpdateWaypointOrder(), VehicleEnterDepot(), and VehicleTimetableSorter().
|
inline |
Does this order have an explicit wait time set?
Definition at line 183 of file order_base.h.
References HasBit(), and IsType().
Referenced by CanDetermineTimeTaken(), CmdChangeTimetable(), DrawOrderString(), GetTimetabledWait(), IsCompletelyTimetabled(), and UpdateVehicleTimetable().
void Order::MakeConditional | ( | VehicleOrderID | order | ) |
Makes this order an conditional order.
order | the order to jump to. |
Definition at line 143 of file order_cmd.cpp.
References dest, flags, and type.
Referenced by OrdersWindow::OnClick().
void Order::MakeDummy | ( | ) |
Makes this order a Dummy order.
Definition at line 133 of file order_cmd.cpp.
Referenced by CheckIfTrainNeedsService(), Vehicle::SendToDepot(), UnpackOldOrder(), UpdateAirplanesOnNewStation(), and VehicleEnterDepot().
void Order::MakeGoToDepot | ( | DepotID | destination, |
OrderDepotTypeFlags | order, | ||
OrderNonStopFlags | non_stop_type = ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS , |
||
OrderDepotActionFlags | action = ODATF_SERVICE_ONLY , |
||
CargoID | cargo = CARGO_NO_REFIT |
||
) |
Makes this order a Go To Depot order.
destination | the depot to go to. |
order | is this order a 'default' order, or an overridden vehicle order? |
non_stop_type | how to get to the depot? |
action | what to do in the depot? |
cargo | the cargo type to change to. |
Definition at line 90 of file order_cmd.cpp.
References dest, SetDepotActionType(), SetDepotOrderType(), SetNonStopType(), SetRefit(), and type.
Referenced by CheckIfTrainNeedsService(), GetOrderCmdFromTile(), OrdersWindow::OrderClick_NearestDepot(), and Vehicle::SendToDepot().
void Order::MakeGoToStation | ( | StationID | destination | ) |
Makes this order a Go To Station order.
destination | the station to go to. |
Definition at line 75 of file order_cmd.cpp.
References dest, flags, and type.
Referenced by GetOrderCmdFromTile().
void Order::MakeGoToWaypoint | ( | StationID | destination | ) |
Makes this order a Go To Waypoint order.
destination | the waypoint to go to. |
Definition at line 104 of file order_cmd.cpp.
References dest, flags, and type.
Referenced by GetOrderCmdFromTile(), and UpdateWaypointOrder().
void Order::MakeImplicit | ( | StationID | destination | ) |
Makes this order an implicit order.
destination | the station to go to. |
Definition at line 154 of file order_cmd.cpp.
Referenced by Vehicle::BeginLoading().
void Order::MakeLeaveStation | ( | ) |
Makes this order a Leave Station order.
Definition at line 124 of file order_cmd.cpp.
Referenced by Vehicle::LeaveStation().
void Order::MakeLoading | ( | bool | ordered | ) |
Makes this order a Loading order.
ordered | is this an ordered stop? |
Definition at line 115 of file order_cmd.cpp.
Referenced by Vehicle::BeginLoading().
uint16_t Order::MapOldOrder | ( | ) | const |
Pack this order into a 16 bits integer as close to the TTD representation as possible.
Definition at line 208 of file order_cmd.cpp.
References GB(), GetDepotOrderType(), GetDestination(), GetLoadType(), GetNonStopType(), GetType(), GetUnloadType(), ODTFB_PART_OF_ORDERS, OLFB_FULL_LOAD, ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS, OUFB_UNLOAD, SetBit(), and type.
uint32_t Order::Pack | ( | ) | const |
Pack this order into a 32 bits integer, or actually only the type, flags and destination.
Definition at line 198 of file order_cmd.cpp.
|
inline |
Set the comparator to use.
Definition at line 171 of file order_base.h.
References SB().
Referenced by CmdModifyOrder().
|
inline |
Get the order to skip to.
Definition at line 173 of file order_base.h.
Referenced by CmdModifyOrder().
|
inline |
Set the value to base the skip on.
Definition at line 175 of file order_base.h.
References SB().
Referenced by CmdModifyOrder().
|
inline |
Set variable we have to compare.
Definition at line 169 of file order_base.h.
References SB().
Referenced by CmdModifyOrder().
|
inline |
Set what we are going to do in the depot.
Definition at line 167 of file order_base.h.
References SB().
Referenced by CmdModifyOrder(), CmdOrderRefit(), ConvertFromOldSavegame(), GetOrderCmdFromTile(), MakeGoToDepot(), OrdersWindow::OrderClick_NearestDepot(), and Vehicle::SendToDepot().
|
inline |
Set the cause to go to the depot.
Definition at line 165 of file order_base.h.
References SB().
Referenced by CmdModifyOrder(), CmdOrderRefit(), ConvertFromOldSavegame(), MakeGoToDepot(), and Vehicle::SendToDepot().
|
inline |
Sets the destination of this order.
destination | the new destination of the order. |
Definition at line 110 of file order_base.h.
Referenced by UpdateOrderDest(), and UpdateWaypointOrder().
|
inline |
Set how the consist must be loaded.
Definition at line 157 of file order_base.h.
References SB().
Referenced by CancelLoadingDueToDeletedOrder(), CmdModifyOrder(), ConvertFromOldSavegame(), and GetOrderCmdFromTile().
|
inline |
Set the maxmimum speed in km-ish/h a vehicle is allowed to reach on the way to the destination.
speed | Speed to be set. |
Definition at line 225 of file order_base.h.
Referenced by ChangeTimetable().
|
inline |
Set whether we must stop at stations or not.
Definition at line 161 of file order_base.h.
References SB().
Referenced by Vehicle::BeginLoading(), CancelLoadingDueToDeletedOrder(), CmdModifyOrder(), ConvertFromOldSavegame(), GetOrderCmdFromTile(), and MakeGoToDepot().
void Order::SetRefit | ( | CargoID | cargo | ) |
Make this depot/station order also a refit order.
cargo | the cargo type to change to. |
Definition at line 165 of file order_cmd.cpp.
References refit_cargo.
Referenced by CmdModifyOrder(), CmdOrderRefit(), and MakeGoToDepot().
|
inline |
Set where we must stop at the platform.
Definition at line 163 of file order_base.h.
References SB().
Referenced by CmdModifyOrder(), ConvertFromOldSavegame(), and GetOrderCmdFromTile().
|
inline |
Set the time in ticks to take for travelling to the destination.
time | Time to set as travel time. |
Definition at line 218 of file order_base.h.
Referenced by ChangeTimetable().
|
inline |
Set if the travel time is explicitly timetabled (unless the order is conditional).
Definition at line 206 of file order_base.h.
References AssignBit(), and IsType().
Referenced by ChangeTimetable().
|
inline |
Set how the consist must be unloaded.
Definition at line 159 of file order_base.h.
References SB().
Referenced by CmdModifyOrder(), and ConvertFromOldSavegame().
|
inline |
Set the time in ticks to wait at the destination.
time | Time to set as wait time. |
Definition at line 212 of file order_base.h.
Referenced by ChangeTimetable(), and UpdateVehicleTimetable().
|
inline |
Set if the wait time is explicitly timetabled (unless the order is conditional).
Definition at line 204 of file order_base.h.
References AssignBit(), and IsType().
Referenced by ChangeTimetable().
bool Order::ShouldStopAtStation | ( | const Vehicle * | v, |
StationID | station | ||
) | const |
Check whether the given vehicle should stop at the given station based on this order and the non-stop settings.
v | the vehicle that might be stopping. |
station | the station to stop at. |
Definition at line 2225 of file order_cmd.cpp.
References dest, GetDepotOrderType(), GetNonStopType(), IsType(), Vehicle::last_station_visited, ODTFB_PART_OF_ORDERS, ONSF_NO_STOP_AT_DESTINATION_STATION, and ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS.
Referenced by CheckNextTrainTile(), Train::GetCurrentMaxSpeed(), and Vehicle::ShowVisualEffect().
|
friend |
Saving and loading of orders.
Definition at line 105 of file order_sl.cpp.
|
friend |
Definition at line 24 of file order_cmd.h.
|
friend |
Definition at line 41 of file order_cmd.h.
|
friend |
Definition at line 41 of file order_base.h.
|
friend |
Definition at line 42 of file order_base.h.
|
friend |
Loading of ancient vehicles.
Definition at line 38 of file order_base.h.
|
private |
The destination of the order.
Definition at line 50 of file order_base.h.
Referenced by AssignOrder(), Equals(), Free(), GetDestination(), MakeConditional(), MakeGoToDepot(), MakeGoToStation(), MakeGoToWaypoint(), MakeImplicit(), Pack(), and ShouldStopAtStation().
|
private |
Load/unload types, depot order/action types.
Definition at line 49 of file order_base.h.
Referenced by AssignOrder(), ConvertFromOldSavegame(), Equals(), Free(), GetConditionSkipToOrder(), VEHSChunkHandler::Load(), MakeConditional(), MakeDummy(), MakeGoToStation(), MakeGoToWaypoint(), MakeLeaveStation(), MakeLoading(), and Pack().
|
private |
How fast the vehicle may go on the way to the destination.
Definition at line 56 of file order_base.h.
Referenced by AssignOrder(), and GetMaxSpeed().
Order* Order::next = nullptr |
Pointer to next order. If nullptr, end of list.
Definition at line 59 of file order_base.h.
Referenced by Vehicle::BeginLoading(), CheckAircraftOrderDistance(), CmdCloneOrder(), OrderList::DeleteOrderAt(), DeleteStaleLinks(), Vehicle::DeleteUnreachedImplicitOrders(), DrawOrderString(), DrawSmallOrderList(), TimetableWindow::DrawTimetablePanel(), OrdersWindow::DrawWidget(), FillTimetableArrivalDepartureTable(), FindVehiclesWithOrder(), Free(), OrderList::FreeChain(), OrderList::GetNext(), OrderList::GetOrderAt(), GetOrderDistance(), OrderList::Initialize(), OrderList::InsertOrderAt(), OrderList::IsCompleteTimetable(), ORDRChunkHandler::Load(), MoveBuoysToWaypoints(), OrderList::MoveOrder(), MoveWaypointsToBaseStations(), OrdersWindow::OnClick(), OrderBackup::OrderBackup(), OrdersWindow::OrderClick_NearestDepot(), OrderList::RecalculateTimetableDuration(), VehiclesHaveSameOrderList(), and OrderBackup::~OrderBackup().
|
private |
Refit CargoID.
Definition at line 52 of file order_base.h.
Referenced by AssignOrder(), GetRefitCargo(), and SetRefit().
|
private |
How long in ticks the journey to this destination should take.
Definition at line 55 of file order_base.h.
Referenced by AssignOrder(), GetTimetabledTravel(), and GetTravelTime().
|
private |
The type of order + non-stop flags.
Definition at line 48 of file order_base.h.
Referenced by AssignOrder(), Equals(), Free(), IsType(), VEHSChunkHandler::Load(), MakeConditional(), MakeDummy(), MakeGoToDepot(), MakeGoToStation(), MakeGoToWaypoint(), MakeImplicit(), MakeLeaveStation(), MakeLoading(), MapOldOrder(), and Pack().
|
private |
How long in ticks to wait at the destination.
Definition at line 54 of file order_base.h.
Referenced by AssignOrder(), GetTimetabledWait(), and GetWaitTime().