OpenTTD Source
20240919-master-gdf0233f4c2
|
Go to the documentation of this file.
10 #include "../stdafx.h"
11 #include "../company_base.h"
12 #include "../settings_type.h"
13 #include "../string_func.h"
18 #include "../safeguards.h"
30 if (c !=
nullptr && c->ai_config !=
nullptr)
return c->ai_config.get();
34 if (*config ==
nullptr) *config =
new AIConfig();
38 class AIInfo *AIConfig::GetInfo()
const
51 return this->
info !=
nullptr;
class AIConfig * ai_config[MAX_COMPANIES]
settings per company
static Titem * GetIfValid(size_t index)
Returns Titem with given index.
Owner
Enum for all companies/owners.
int version
Version of the script.
@ SSS_DEFAULT
Get the Script config from the current game mode.
class ScriptInfo * GetInfo() const
Get the ScriptInfo linked to this ScriptConfig.
static AIConfig * GetConfig(CompanyID company, ScriptSettingSource source=SSS_DEFAULT)
Get the config of a company.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
int version
Version of the Script.
ScriptInfo * FindInfo(const std::string &name, int version, bool force_exact_match) override
This function should call back to the Scanner in charge of this Config, to find the ScriptInfo belong...
class ScriptInfo * info
ScriptInfo object for related to this Script version.
@ SSS_FORCE_NEWGAME
Get the newgame Script config.
std::string name
Full name of the script.
std::string name
Name of the Script.
All static information from an AI like name, version, etc.
static class AIInfo * FindInfo(const std::string &name, int version, bool force_exact_match)
Wrapper function for AIScanner::FindInfo.
@ MAX_COMPANIES
Maximum number of companies.
All static information from an Script like name, version, etc.
@ SSS_FORCE_GAME
Get the Script config from the current game.
GameSettings _settings_newgame
Game settings for new games (updated from the intro screen).
bool ResetInfo(bool force_exact_match)
When ever the AI Scanner is reloaded, all infos become invalid.
ScriptSettingSource
Where to get the config from, either default (depends on current game mode) or force either newgame o...