OpenTTD Source  12.0-beta2
station_sl.cpp File Reference
#include "../stdafx.h"
#include "saveload.h"
#include "compat/station_sl_compat.h"
#include "../station_base.h"
#include "../waypoint_base.h"
#include "../roadstop_base.h"
#include "../vehicle_base.h"
#include "../newgrf_station.h"
#include "table/strings.h"
#include "../safeguards.h"

Go to the source code of this file.

Data Structures

struct  FlowSaveLoad
 
class  SlStationSpecList
 
class  SlStationCargo
 
class  SlStationFlow
 
class  SlStationGoods
 
struct  STNSChunkHandler
 
class  SlStationBase
 SaveLoad handler for the BaseStation, which all other stations / waypoints make use of. More...
 
class  SlStationNormal
 SaveLoad handler for a normal station (read: not a waypoint). More...
 
class  SlStationWaypoint
 
struct  STNNChunkHandler
 
struct  ROADChunkHandler
 

Typedefs

typedef std::pair< const StationID, std::list< CargoPacket * > > StationCargoPair
 

Functions

static void UpdateWaypointOrder (Order *o)
 Update the buoy orders to be waypoint orders. More...
 
void MoveBuoysToWaypoints ()
 Perform all steps to upgrade from the old station buoys to the new version that uses waypoints. More...
 
void AfterLoadStations ()
 
void AfterLoadRoadStops ()
 (Re)building of road stop caches after loading a savegame.
 
static void SwapPackets (GoodsEntry *ge)
 Swap the temporary packets with the packets without specific destination in the given goods entry. More...
 

Variables

static const SaveLoad _roadstop_desc []
 
static uint16 _waiting_acceptance
 
static uint32 _old_num_flows
 
static uint16 _cargo_source
 
static uint32 _cargo_source_xy
 
static uint8 _cargo_days
 
static Money _cargo_feeder_share
 
std::list< CargoPacket * > _packets
 
uint32 _old_num_dests
 
static OldPersistentStorage _old_st_persistent_storage
 
static const SaveLoad _old_station_desc []
 
static const SaveLoad _station_desc []
 
static const STNSChunkHandler STNS
 
static const STNNChunkHandler STNN
 
static const ROADChunkHandler ROAD
 
static const ChunkHandlerRef station_chunk_handlers []
 
const ChunkHandlerTable _station_chunk_handlers (station_chunk_handlers)
 

Detailed Description

Code handling saving and loading of stations.

Definition in file station_sl.cpp.

Function Documentation

◆ MoveBuoysToWaypoints()

◆ SwapPackets()

static void SwapPackets ( GoodsEntry ge)
static

Swap the temporary packets with the packets without specific destination in the given goods entry.

Assert that at least one of those is empty.

Parameters
geGoods entry to swap with.

Definition at line 179 of file station_sl.cpp.

References GoodsEntry::cargo, and CargoList< Tinst, Tcont >::Packets().

◆ UpdateWaypointOrder()

static void UpdateWaypointOrder ( Order o)
static

Update the buoy orders to be waypoint orders.

Parameters
othe order 'list' to check.

Definition at line 29 of file station_sl.cpp.

References Order::IsType().

Referenced by MoveBuoysToWaypoints().

Variable Documentation

◆ _roadstop_desc

const SaveLoad _roadstop_desc[]
static
Initial value:
= {
SLE_VAR(RoadStop, xy, SLE_UINT32),
SLE_VAR(RoadStop, status, SLE_UINT8),
}

Definition at line 146 of file station_sl.cpp.

◆ _station_desc

const SaveLoad _station_desc[]
static
Initial value:

Definition at line 651 of file station_sl.cpp.

◆ station_chunk_handlers

const ChunkHandlerRef station_chunk_handlers[]
static
Initial value:
= {
STNS,
STNN,
ROAD,
}

Definition at line 738 of file station_sl.cpp.

SLEG_CONDSTRUCTLIST
#define SLEG_CONDSTRUCTLIST(name, handler, from, to)
Storage of a list of structs in some savegame versions.
Definition: saveload.h:929
REF_ROADSTOPS
@ REF_ROADSTOPS
Load/save a reference to a bus/truck stop.
Definition: saveload.h:540
SlStationWaypoint
Definition: station_sl.cpp:620
SLE_REF
#define SLE_REF(base, variable, type)
Storage of a reference in every version of a savegame.
Definition: saveload.h:780
SlStationNormal
SaveLoad handler for a normal station (read: not a waypoint).
Definition: station_sl.cpp:562
SLE_SAVEBYTE
#define SLE_SAVEBYTE(base, variable)
Only write byte during saving; never read it during loading.
Definition: saveload.h:826
SLV_27
@ SLV_27
27 4757
Definition: saveload.h:79
SL_MAX_VERSION
@ SL_MAX_VERSION
Highest possible saveload version.
Definition: saveload.h:342
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:772
BaseStation
Base class for all station-ish types.
Definition: base_station_base.h:52
RoadStop
A Stop for a Road Vehicle.
Definition: roadstop_base.h:22
SlStationSpecList
Definition: station_sl.cpp:196
SLEG_STRUCT
#define SLEG_STRUCT(name, handler)
Storage of a structs in every savegame version.
Definition: saveload.h:976