OpenTTD Source 20260711-master-g3fb3006dff
SlVehicleRoadVeh Class Reference
Inheritance diagram for SlVehicleRoadVeh:
DefaultSaveLoadHandler< SlVehicleRoadVeh, Vehicle > SaveLoadHandler

Public Member Functions

void Save (Vehicle *v) const override
 Save the object to disk.
void Load (Vehicle *v) const override
 Load the object from disk.
void FixPointers (Vehicle *v) const override
 A post-load callback to fix SaveLoadType::Reference integers into pointers.
Public Member Functions inherited from DefaultSaveLoadHandler< SlVehicleRoadVeh, Vehicle >
SaveLoadTable GetDescription () const override
 Get the description of the fields in the savegame.
SaveLoadCompatTable GetCompatDescription () const override
 Get the pre-header description of the fields in the savegame.
virtual void LoadCheck (Vehicle *object) const
 Similar to load, but used only to validate savegames.
Public Member Functions inherited from SaveLoadHandler
virtual ~SaveLoadHandler ()=default
 Ensure the destructor of the sub classes are called as well.
virtual void Save (void *object) const
 Save the object to disk.
virtual void Load (void *object) const
 Load the object from disk.
virtual void LoadCheck (void *object) const
 Similar to load, but used only to validate savegames.
virtual void FixPointers (void *object) const
 A post-load callback to fix SaveLoadType::Reference integers into pointers.
SaveLoadTable GetLoadDescription () const
 Get the description for how to load the chunk.

Static Public Member Functions

static void ConvertPathCache (RoadVehicle &rv)

Static Public Attributes

static const SaveLoad description []
static const SaveLoadCompatTable compat_description = _vehicle_roadveh_sl_compat
static std::vector< Trackdirrv_path_td
static std::vector< TileIndexrv_path_tile

Additional Inherited Members

Data Fields inherited from SaveLoadHandler
std::optional< std::vector< SaveLoad > > load_description
 Description derived from savegame being loaded.

Detailed Description

Definition at line 850 of file vehicle_sl.cpp.

Member Function Documentation

◆ ConvertPathCache()

void SlVehicleRoadVeh::ConvertPathCache ( RoadVehicle & rv)
inlinestatic

Definition at line 874 of file vehicle_sl.cpp.

◆ FixPointers()

void SlVehicleRoadVeh::FixPointers ( Vehicle * object) const
inlineoverridevirtual

A post-load callback to fix SaveLoadType::Reference integers into pointers.

Parameters
objectThe object to fix.

Reimplemented from DefaultSaveLoadHandler< SlVehicleRoadVeh, Vehicle >.

Definition at line 908 of file vehicle_sl.cpp.

References DefaultSaveLoadHandler< SlVehicleRoadVeh, Vehicle >::GetDescription(), Road, SlObject(), and BaseVehicle::type.

◆ Load()

void SlVehicleRoadVeh::Load ( Vehicle * object) const
inlineoverridevirtual

Load the object from disk.

Parameters
objectThe object to load.

Reimplemented from DefaultSaveLoadHandler< SlVehicleRoadVeh, Vehicle >.

Definition at line 899 of file vehicle_sl.cpp.

References SaveLoadHandler::GetLoadDescription(), IsSavegameVersionBefore(), PathCacheFormat, Road, RoadvehPathCache, SlObject(), and BaseVehicle::type.

◆ Save()

void SlVehicleRoadVeh::Save ( Vehicle * object) const
inlineoverridevirtual

Save the object to disk.

Parameters
objectThe object to store.

Reimplemented from DefaultSaveLoadHandler< SlVehicleRoadVeh, Vehicle >.

Definition at line 893 of file vehicle_sl.cpp.

References DefaultSaveLoadHandler< SlVehicleRoadVeh, Vehicle >::GetDescription(), Road, SlObject(), and BaseVehicle::type.

Field Documentation

◆ compat_description

const SaveLoadCompatTable SlVehicleRoadVeh::compat_description = _vehicle_roadveh_sl_compat
inlinestatic

Definition at line 872 of file vehicle_sl.cpp.

◆ description

const SaveLoad SlVehicleRoadVeh::description[]
inlinestatic
Initial value:
= {
SLE_VAR(RoadVehicle, overtaking_ctr, VarTypes::U8),
}
static std::vector< TileIndex > rv_path_tile
static std::vector< Trackdir > rv_path_td
#define SLEG_CONDVECTOR(name, variable, type, from, to)
Storage of a global vector of SaveLoadType::Variable elements in some savegame versions.
Definition saveload.h:1184
#define SLEG_STRUCT(name, handler)
Storage of a structs in every savegame version.
Definition saveload.h:1233
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition saveload.h:904
@ PathCacheFormat
Saveload version: 346, GitHub pull request: 12345 Vehicle path cache format changed.
Definition saveload.h:395
@ RoadvehPathCache
Saveload version: 211, GitHub pull request: 7261 Add path cache for road vehicles.
Definition saveload.h:297
@ RvRealisticAcceleration
Saveload version: 139, SVN revision: 19346 Realistic acceleration of road vehicles.
Definition saveload.h:210
@ MaxVersion
Highest possible saveload version.
Definition saveload.h:421
#define SLEG_CONDSTRUCTLIST(name, handler, from, to)
Storage of a list of structs in some savegame versions.
Definition saveload.h:1193
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition saveload.h:1017
Buses, trucks and trams belong to this class.
Definition roadveh.h:105
static constexpr VarType U16
Store a 16 bits unsigned int.
Definition saveload.h:754
static constexpr VarType U8
Store a 8 bits unsigned int.
Definition saveload.h:752
static constexpr VarType U32
Store a 32 bits unsigned int.
Definition saveload.h:756

Definition at line 858 of file vehicle_sl.cpp.

◆ rv_path_td

std::vector<Trackdir> SlVehicleRoadVeh::rv_path_td
inlinestatic

RoadVehicle path is stored in std::pair which cannot be directly saved.

Definition at line 854 of file vehicle_sl.cpp.

◆ rv_path_tile

std::vector<TileIndex> SlVehicleRoadVeh::rv_path_tile
inlinestatic

RoadVehicle path is stored in std::pair which cannot be directly saved.

Definition at line 855 of file vehicle_sl.cpp.


The documentation for this class was generated from the following file: