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

Handles the saveload part of the AIs. More...

#include "../stdafx.h"
#include "../debug.h"
#include "saveload.h"
#include "compat/ai_sl_compat.h"
#include "../company_base.h"
#include "../string_func.h"
#include "../ai/ai.hpp"
#include "../ai/ai_config.hpp"
#include "../network/network.h"
#include "../ai/ai_instance.hpp"
#include "../safeguards.h"

Go to the source code of this file.

Data Structures

struct  AIPLChunkHandler
 

Functions

static void SaveReal_AIPL (int arg)
 
const ChunkHandlerTable _ai_chunk_handlers (ai_chunk_handlers)
 

Variables

static std::string _ai_saveload_name
 
static int _ai_saveload_version
 
static std::string _ai_saveload_settings
 
static bool _ai_saveload_is_random
 
static const SaveLoad _ai_company_desc []
 
static const SaveLoad _ai_running_desc []
 
static const AIPLChunkHandler AIPL
 
static const ChunkHandlerRef ai_chunk_handlers []
 

Detailed Description

Handles the saveload part of the AIs.

Definition in file ai_sl.cpp.

Variable Documentation

◆ _ai_company_desc

const SaveLoad _ai_company_desc[]
static
Initial value:
= {
SLEG_SSTR("name", _ai_saveload_name, SLE_STR),
SLEG_SSTR("settings", _ai_saveload_settings, SLE_STR),
SLEG_CONDVAR("version", _ai_saveload_version, SLE_UINT32, SLV_108, SL_MAX_VERSION),
SLEG_CONDVAR("is_random", _ai_saveload_is_random, SLE_BOOL, SLV_136, SLV_AI_LOCAL_CONFIG),
}
#define SLEG_CONDVAR(name, variable, type, from, to)
Storage of a global variable in some savegame versions.
Definition: saveload.h:1086
#define SLEG_SSTR(name, variable, type)
Storage of a global std::string in every savegame version.
Definition: saveload.h:1187
@ SLV_AI_LOCAL_CONFIG
332 PR#12003 Config of running AI is stored inside Company.
Definition: saveload.h:378
@ SL_MAX_VERSION
Highest possible saveload version.
Definition: saveload.h:397
@ SLV_108
108 15045
Definition: saveload.h:172
@ SLV_136
136 18764
Definition: saveload.h:206

Definition at line 31 of file ai_sl.cpp.

◆ _ai_running_desc

const SaveLoad _ai_running_desc[]
static
Initial value:
= {
SLEG_CONDSSTR("running_name", _ai_saveload_name, SLE_STR, SLV_AI_LOCAL_CONFIG, SL_MAX_VERSION),
SLEG_CONDSSTR("running_settings", _ai_saveload_settings, SLE_STR, SLV_AI_LOCAL_CONFIG, SL_MAX_VERSION),
SLEG_CONDVAR("running_version", _ai_saveload_version, SLE_UINT32, SLV_AI_LOCAL_CONFIG, SL_MAX_VERSION),
}
#define SLEG_CONDSSTR(name, variable, type, from, to)
Storage of a global std::string in some savegame versions.
Definition: saveload.h:1117

Definition at line 38 of file ai_sl.cpp.

◆ ai_chunk_handlers

const ChunkHandlerRef ai_chunk_handlers[]
static
Initial value:
= {
AIPL,
}

Definition at line 171 of file ai_sl.cpp.