#include <vehicle_base.h>
Public Member Functions | |
FORCEINLINE | SpecializedVehicle () |
Set vehicle type correctly. | |
FORCEINLINE T * | First () const |
Get the first vehicle in the chain. | |
FORCEINLINE T * | Last () |
Get the last vehicle in the chain. | |
FORCEINLINE const T * | Last () const |
Get the last vehicle in the chain. | |
FORCEINLINE T * | Next () const |
Get next vehicle in the chain. | |
FORCEINLINE T * | Previous () const |
Get previous vehicle in the chain. | |
Static Public Member Functions | |
static FORCEINLINE bool | IsValidID (size_t index) |
Tests whether given index is a valid index for vehicle of this type. | |
static FORCEINLINE T * | Get (size_t index) |
Gets vehicle with given index. | |
static FORCEINLINE T * | GetIfValid (size_t index) |
Returns vehicle if the index is a valid index for this vehicle type. | |
static FORCEINLINE T * | From (Vehicle *v) |
Converts a Vehicle to SpecializedVehicle with type checking. | |
static FORCEINLINE const T * | From (const Vehicle *v) |
Converts a const Vehicle to const SpecializedVehicle with type checking. | |
Static Public Attributes | |
static const VehicleType | EXPECTED_TYPE = Type |
Specialized type. |
Definition at line 585 of file vehicle_base.h.
FORCEINLINE T* SpecializedVehicle< T, Type >::First | ( | ) | const [inline] |
Get the first vehicle in the chain.
Definition at line 597 of file vehicle_base.h.
Referenced by BuildDepotVehicleList(), CheckTrainsLengths(), CmdAutoreplaceVehicle(), CmdBuildRailWagon(), CmdMoveRailVehicle(), CmdRefitRailVehicle(), CmdRefitRoadVeh(), CmdReverseTrainDirection(), CmdSellRailWagon(), DeleteLastWagon(), FindTrainOnTrackEnum(), FollowTrainReservation(), RemoveRoadStop(), UpdateTrainPowerProc(), and VehicleEnter_Track().
FORCEINLINE T* SpecializedVehicle< T, Type >::Last | ( | ) | [inline] |
Get the last vehicle in the chain.
Definition at line 603 of file vehicle_base.h.
Referenced by AdvanceWagonsAfterSwap(), AdvanceWagonsBeforeSwap(), CmdBuildRailWagon(), DeleteVisibleTrain(), InsertInConsist(), NPFTrainCheckReverse(), NPFTrainFindNearestDepot(), RemoveFromConsist(), YapfTrainCheckReverse(), and YapfTrainFindNearestDepot().
FORCEINLINE const T* SpecializedVehicle< T, Type >::Last | ( | ) | const [inline] |
Get the last vehicle in the chain.
Definition at line 609 of file vehicle_base.h.
FORCEINLINE T* SpecializedVehicle< T, Type >::Next | ( | ) | const [inline] |
Get next vehicle in the chain.
Definition at line 615 of file vehicle_base.h.
Referenced by AdvanceWagonsAfterSwap(), AdvanceWagonsBeforeSwap(), AircraftController(), CheckTrainAttachment(), CheckTrainsLengths(), CmdBuildRailStation(), CmdBuildRoadVeh(), CmdCloneVehicle(), CmdReverseTrainDirection(), CmdSellRailWagon(), ConvertOldMultiheadToNew(), DeleteLastWagon(), DrawAircraftDetails(), DrawRoadVehImage(), DrawTrainDetails(), DrawTrainImage(), GetCargoSummaryOfArticulatedVehicle(), GetLengthOfArticulatedVehicle(), Train::GetNextVehicle(), GetTrainAcceleration(), GetTrainCurveSpeedLimit(), HandleAircraftEnterHangar(), InsertInConsist(), MakeTrainBackup(), NormaliseDualHeads(), NormaliseSubtypes(), RemoveFromConsist(), RemoveFromRailBaseStation(), Train::ReserveTrackUnderConsist(), SetTrainGroupID(), StateGameLoop(), TrainCargoChanged(), TrainConsistChanged(), TrainPowerChanged(), UpdateOldAircraft(), UpdateTrainGroupID(), VehicleEnter_Track(), and VehicleLengthSorter().
FORCEINLINE T* SpecializedVehicle< T, Type >::Previous | ( | ) | const [inline] |
Get previous vehicle in the chain.
Definition at line 621 of file vehicle_base.h.
Referenced by AdvanceWagonsAfterSwap(), AdvanceWagonsBeforeSwap(), DeleteVisibleTrain(), Train::GetFirstEnginePart(), Train::GetPrevVehicle(), NormaliseSubtypes(), RemoveFromConsist(), and RestoreTrainBackup().
static FORCEINLINE bool SpecializedVehicle< T, Type >::IsValidID | ( | size_t | index | ) | [inline, static] |
Tests whether given index is a valid index for vehicle of this type.
index | tested index |
Reimplemented from Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem< Tpool >.
Definition at line 629 of file vehicle_base.h.
Referenced by SpecializedVehicle< RoadVehicle, VEH_ROAD >::GetIfValid().
static FORCEINLINE T* SpecializedVehicle< T, Type >::Get | ( | size_t | index | ) | [inline, static] |
Gets vehicle with given index.
Reimplemented from Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem< Tpool >.
Definition at line 638 of file vehicle_base.h.
Referenced by SpecializedVehicle< RoadVehicle, VEH_ROAD >::GetIfValid().
static FORCEINLINE T* SpecializedVehicle< T, Type >::GetIfValid | ( | size_t | index | ) | [inline, static] |
Returns vehicle if the index is a valid index for this vehicle type.
Reimplemented from Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tcache, Tzero >::PoolItem< Tpool >.
Definition at line 647 of file vehicle_base.h.
static FORCEINLINE T* SpecializedVehicle< T, Type >::From | ( | Vehicle * | v | ) | [inline, static] |
Converts a Vehicle to SpecializedVehicle with type checking.
v | Vehicle pointer |
Definition at line 657 of file vehicle_base.h.
static FORCEINLINE const T* SpecializedVehicle< T, Type >::From | ( | const Vehicle * | v | ) | [inline, static] |
Converts a const Vehicle to const SpecializedVehicle with type checking.
v | Vehicle pointer |
Definition at line 668 of file vehicle_base.h.