12 #include "../stdafx.h" 13 #include "../station_map.h" 14 #include "../tunnelbridge_map.h" 18 #include "../safeguards.h" 29 for (uint i = 0; i < _railtype_list.
Length(); i++) {
32 if (rti->
label != _railtype_list[i])
return true;
34 if (_railtype_list[i] != 0)
return true;
42 void AfterLoadLabelMaps()
47 for (uint i = 0; i < _railtype_list.
Length(); i++) {
51 *railtype_conversion_map.
Append() = r;
84 _railtype_list.
Clear();
92 static const SaveLoad _label_object_desc[] = {
97 static void Save_RAIL()
109 static void Load_RAIL()
111 _railtype_list.
Clear();
117 *_railtype_list.
Append() = (RailTypeLabel)lo.label;
121 extern const ChunkHandler _labelmaps_chunk_handlers[] = {
122 {
'RAIL', Save_RAIL, Load_RAIL, NULL, NULL, CH_ARRAY |
CH_LAST},
static TileType GetTileType(TileIndex tile)
Get the tiletype of a given tile.
static const RailtypeInfo * GetRailTypeInfo(RailType railtype)
Returns a pointer to the Railtype information for a given railtype.
static TransportType GetTunnelBridgeTransportType(TileIndex t)
Tunnel: Get the transport type of the tunnel (road or rail) Bridge: Get the transport type of the bri...
RailType
Enumeration for all possible railtypes.
A tile with road (or tram tracks)
void Clear()
Remove all items from the list.
Simple vector template class.
static bool IsLevelCrossing(TileIndex t)
Return whether a tile is a level crossing.
This struct contains all the info that is needed to draw and construct tracks.
T * Append(uint to_add=1)
Append an item and return it.
static bool HasStationRail(TileIndex t)
Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint...
Functions/types related to saving and loading games.
uint Length() const
Get the number of items in the list.
RailTypeLabel label
Unique 32 bit rail type identifier.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
Handlers and description of chunk.
#define SLE_END()
End marker of a struct/class save or load.
Container for a label for SaveLoad system.
static uint MapSize()
Get the size of the map.
Tunnel entry/exit and bridge heads.
uint32 TileIndex
The index/ID of a Tile.
void SlObject(void *object, const SaveLoad *sld)
Main SaveLoad function.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Flag for invalid railtype.
RailType GetRailTypeByLabel(RailTypeLabel label, bool allow_alternate_labels)
Get the rail type for a given label.
static bool NeedRailTypeConversion()
Test if any saved rail type labels are different to the currently loaded rail types, which therefore requires conversion.
static RailType GetRailType(TileIndex t)
Gets the rail type of the given tile.
Last chunk in this array.
static void SetRailType(TileIndex t, RailType r)
Sets the rail type of the given tile.