OpenTTD Source 20260711-master-g3fb3006dff
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.

Function Documentation

◆ SaveReal_AIPL()

void SaveReal_AIPL ( int arg)
static

Definition at line 44 of file ai_sl.cpp.

Variable Documentation

◆ _ai_company_desc

const SaveLoad _ai_company_desc[]
static
Initial value:
= {
SLEG_SSTR("name", _ai_saveload_name, VarTypes::STR),
SLEG_SSTR("settings", _ai_saveload_settings, VarTypes::STR),
}
#define SLEG_CONDVAR(name, variable, type, from, to)
Storage of a global variable in some savegame versions.
Definition saveload.h:1124
#define SLEG_SSTR(name, variable, type)
Storage of a global std::string in every savegame version.
Definition saveload.h:1226
@ AILocalConfig
Saveload version: 332, GitHub pull request: 12003 Config of running AI is stored inside Company.
Definition saveload.h:378
@ StoreAIVersion
Saveload version: 108, SVN revision: 15045 Store the version of the AI script.
Definition saveload.h:173
@ SplitLoadWaitCounters
Saveload version: 136, SVN revision: 18764 Split counters for (un)loading and signal waiting/turning...
Definition saveload.h:207
@ MaxVersion
Highest possible saveload version.
Definition saveload.h:421
static constexpr VarType STR
Store string.
Definition saveload.h:760
static constexpr VarType U32
Store a 32 bits unsigned int.
Definition saveload.h:756
static constexpr VarType BOOL
Store a boolean (as int8).
Definition saveload.h:750

Definition at line 31 of file ai_sl.cpp.

◆ _ai_running_desc

const SaveLoad _ai_running_desc[]
static
Initial value:
= {
}
#define SLEG_CONDSSTR(name, variable, type, from, to)
Storage of a global std::string in some savegame versions.
Definition saveload.h:1155

Definition at line 38 of file ai_sl.cpp.

◆ _ai_saveload_is_random

bool _ai_saveload_is_random
static

Definition at line 29 of file ai_sl.cpp.

◆ _ai_saveload_name

std::string _ai_saveload_name
static

Definition at line 26 of file ai_sl.cpp.

◆ _ai_saveload_settings

std::string _ai_saveload_settings
static

Definition at line 28 of file ai_sl.cpp.

◆ _ai_saveload_version

int _ai_saveload_version
static

Definition at line 27 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.

◆ AIPL

const AIPLChunkHandler AIPL
static

Definition at line 170 of file ai_sl.cpp.