OpenTTD Source  20241121-master-g67a0fccfad
industry_sl.cpp File Reference

Code handling saving and loading of industries. More...

#include "../stdafx.h"
#include "saveload.h"
#include "compat/industry_sl_compat.h"
#include "../industry.h"
#include "newgrf_sl.h"
#include "../safeguards.h"

Go to the source code of this file.

Data Structures

class  SlIndustryAccepted
 
class  SlIndustryProducedHistory
 
class  SlIndustryProduced
 
struct  INDYChunkHandler
 
struct  IIDSChunkHandler
 
struct  TIDSChunkHandler
 
struct  IBLDChunkHandler
 Industry builder. More...
 
struct  ITBLChunkHandler
 Industry-type build data. More...
 

Functions

const ChunkHandlerTable _industry_chunk_handlers (industry_chunk_handlers)
 

Variables

static OldPersistentStorage _old_ind_persistent_storage
 
static const SaveLoad _industry_desc []
 
static const SaveLoad _industry_builder_desc []
 Description of the data to save and load in IndustryBuildData. More...
 
static const SaveLoad _industrytype_builder_desc []
 Description of the data to save and load in IndustryTypeBuildData. More...
 
static const INDYChunkHandler INDY
 
static const IIDSChunkHandler IIDS
 
static const TIDSChunkHandler TIDS
 
static const IBLDChunkHandler IBLD
 
static const ITBLChunkHandler ITBL
 
static const ChunkHandlerRef industry_chunk_handlers []
 

Detailed Description

Code handling saving and loading of industries.

Definition in file industry_sl.cpp.

Variable Documentation

◆ _industry_builder_desc

const SaveLoad _industry_builder_desc[]
static
Initial value:
= {
SLEG_VAR("wanted_inds", _industry_builder.wanted_inds, SLE_UINT32),
}
IndustryBuildData _industry_builder
In-game manager of industries.
#define SLEG_VAR(name, variable, type)
Storage of a global variable in every savegame version.
Definition: saveload.h:1163
uint32_t wanted_inds
Number of wanted industries (bits 31-16), and a fraction (bits 15-0).
Definition: industry.h:324

Description of the data to save and load in IndustryBuildData.

Definition at line 253 of file industry_sl.cpp.

Referenced by IBLDChunkHandler::Load(), and IBLDChunkHandler::Save().

◆ _industrytype_builder_desc

const SaveLoad _industrytype_builder_desc[]
static
Initial value:
= {
SLE_VAR(IndustryTypeBuildData, probability, SLE_UINT32),
SLE_VAR(IndustryTypeBuildData, min_number, SLE_UINT8),
SLE_VAR(IndustryTypeBuildData, target_count, SLE_UINT16),
SLE_VAR(IndustryTypeBuildData, max_wait, SLE_UINT16),
SLE_VAR(IndustryTypeBuildData, wait_count, SLE_UINT16),
}
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:987
Data for managing the number of industries of a single industry type.
Definition: industry.h:307

Description of the data to save and load in IndustryTypeBuildData.

Definition at line 280 of file industry_sl.cpp.

Referenced by ITBLChunkHandler::Load(), and ITBLChunkHandler::Save().

◆ industry_chunk_handlers

const ChunkHandlerRef industry_chunk_handlers[]
static
Initial value:
= {
INDY,
IIDS,
TIDS,
IBLD,
ITBL,
}

Definition at line 322 of file industry_sl.cpp.