22 assert(company < MAX_COMPANIES);
28 if (c !=
nullptr && c->ai_config !=
nullptr)
return c->ai_config.get();
32 if (config ==
nullptr) config = std::make_unique<AIConfig>();
50 return this->
info !=
nullptr;
Base functions for all AIs.
AIConfig stores the configuration settings of every AI.
AIInfo keeps track of all information of an AI, like Author, Description, ...
class AIInfo * GetInfo() const
Get the ScriptInfo linked to this ScriptConfig.
static AIConfig * GetConfig(CompanyID company, ScriptSettingSource source=SSS_DEFAULT)
Get the AI configuration of specific company.
bool ResetInfo(bool force_exact_match)
When ever the AI Scanner is reloaded, all infos become invalid.
ScriptInfo * FindInfo(const std::string &name, int version, bool force_exact_match) override
Finds the appropriate ScriptInfo for a given script name and version.
All static information from an AI like name, version, etc.
static class AIInfo * FindInfo(const std::string &name, int version, bool force_exact_match)
Finds the appropriate ScriptInfo for a given script name and version.
ScriptSettingSource
Where to get the config from, either default (depends on current game mode) or force either newgame o...
@ SSS_FORCE_NEWGAME
Get the newgame Script config.
@ SSS_DEFAULT
Get the Script config from the current game mode.
int version
Version of the Script.
class ScriptInfo * info
ScriptInfo object for related to this Script version.
class ScriptInfo * GetInfo() const
Get the ScriptInfo linked to this ScriptConfig.
std::string name
Name of the Script.
All static information from an Script like name, version, etc.
Definition of stuff that is very close to a company, like the company struct itself.
A number of safeguards to prevent using unsafe methods.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
GameSettings _settings_newgame
Game settings for new games (updated from the intro screen).
Types related to global configuration settings.
Definition of base types and functions in a cross-platform compatible way.
Functions related to low-level strings.
static Company * GetIfValid(auto index)