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();
38class AIInfo *AIConfig::GetInfo()
const
51 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, ...
static AIConfig * GetConfig(CompanyID company, ScriptSettingSource source=SSS_DEFAULT)
Get the config of a 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
This function should call back to the Scanner in charge of this Config, to find the ScriptInfo belong...
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.
ScriptSettingSource
Where to get the config from, either default (depends on current game mode) or force either newgame o...
@ SSS_FORCE_GAME
Get the Script config from the current game.
@ 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.
int version
Version of the script.
std::string name
Full name of the script.
Owner
Enum for all companies/owners.
@ MAX_COMPANIES
Maximum number of companies.
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).
class AIConfig * ai_config[MAX_COMPANIES]
settings per company
static Titem * GetIfValid(size_t index)
Returns Titem with given index.