OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
10 #include "../stdafx.h"
16 #include "../station_map.h"
17 #include "../tunnelbridge_map.h"
19 #include "../safeguards.h"
21 static std::vector<RailTypeLabel> _railtype_list;
30 for (uint i = 0; i < _railtype_list.size(); i++) {
33 if (rti->
label != _railtype_list[i])
return true;
35 if (_railtype_list[i] != 0)
return true;
43 void AfterLoadLabelMaps()
46 std::vector<RailType> railtype_conversion_map;
48 for (uint i = 0; i < _railtype_list.size(); i++) {
52 railtype_conversion_map.push_back(r);
90 _railtype_list.clear();
98 static const SaveLoad _label_object_desc[] = {
129 _railtype_list.push_back((RailTypeLabel)lo.label);
139 extern const ChunkHandlerTable _labelmaps_chunk_handlers(labelmaps_chunk_handlers);
uint32 TileIndex
The index/ID of a Tile.
@ TRANSPORT_RAIL
Transport by train.
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
This struct contains all the info that is needed to draw and construct tracks.
Handlers and description of chunk.
@ MP_ROAD
A tile with road (or tram tracks)
static bool IsLevelCrossing(TileIndex t)
Return whether a tile is a level crossing.
const SaveLoadCompat _label_object_sl_compat[]
Original field order for _label_object_desc.
static const RailtypeInfo * GetRailTypeInfo(RailType railtype)
Returns a pointer to the Railtype information for a given railtype.
static uint MapSize()
Get the size of the map.
RailType
Enumeration for all possible railtypes.
static bool HasStationRail(TileIndex t)
Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint?
A trimmed down version of what std::span will be in C++20.
Container for a label for SaveLoad system.
void Load() const override
Load the chunk.
@ MP_TUNNELBRIDGE
Tunnel entry/exit and bridge heads.
static bool NeedRailTypeConversion()
Test if any saved rail type labels are different to the currently loaded rail types,...
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
@ RAILTYPE_END
Used for iterations.
static RailType GetRailType(TileIndex t)
Gets the rail type of the given tile.
@ MP_STATION
A tile of a station.
RailTypeLabel label
Unique 32 bit rail type identifier.
void Save() const override
Save the chunk.
std::vector< SaveLoad > SlCompatTableHeader(const SaveLoadTable &slt, const SaveLoadCompatTable &slct)
Load a table header in a savegame compatible way.
RailType GetRailTypeByLabel(RailTypeLabel label, bool allow_alternate_labels)
Get the rail type for a given label.
static TileType GetTileType(TileIndex tile)
Get the tiletype of a given tile.
void SlObject(void *object, const SaveLoadTable &slt)
Main SaveLoad function.
std::vector< SaveLoad > SlTableHeader(const SaveLoadTable &slt)
Save or Load a table header.
static TransportType GetTunnelBridgeTransportType(TileIndex t)
Tunnel: Get the transport type of the tunnel (road or rail) Bridge: Get the transport type of the bri...
static void SetRailType(TileIndex t, RailType r)
Sets the rail type of the given tile.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
@ INVALID_RAILTYPE
Flag for invalid railtype.
@ RAILTYPE_BEGIN
Used for iterations.