OpenTTD Source  20241108-master-g80f628063a
ai_config.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of OpenTTD.
3  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6  */
7 
10 #ifndef AI_CONFIG_HPP
11 #define AI_CONFIG_HPP
12 
13 #include "../script/script_config.hpp"
14 #include "../company_type.h"
15 
16 class AIConfig : public ScriptConfig {
17 public:
21  static AIConfig *GetConfig(CompanyID company, ScriptSettingSource source = SSS_DEFAULT);
22 
23  AIConfig() :
24  ScriptConfig()
25  {}
26 
27  AIConfig(const AIConfig *config) :
28  ScriptConfig(config)
29  {}
30 
31  class AIInfo *GetInfo() const;
32 
41  bool ResetInfo(bool force_exact_match);
42 
43 protected:
44  ScriptInfo *FindInfo(const std::string &name, int version, bool force_exact_match) override;
45 };
46 
47 #endif /* AI_CONFIG_HPP */
static AIConfig * GetConfig(CompanyID company, ScriptSettingSource source=SSS_DEFAULT)
Get the config of a company.
Definition: ai_config.cpp:20
bool ResetInfo(bool force_exact_match)
When ever the AI Scanner is reloaded, all infos become invalid.
Definition: ai_config.cpp:48
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...
Definition: ai_config.cpp:43
All static information from an AI like name, version, etc.
Definition: ai_info.hpp:16
Script settings.
ScriptSettingSource
Where to get the config from, either default (depends on current game mode) or force either newgame o...
@ SSS_DEFAULT
Get the Script config from the current game mode.
int version
Version of the Script.
std::string name
Name of the Script.
All static information from an Script like name, version, etc.
Definition: script_info.hpp:30
Owner
Enum for all companies/owners.
Definition: company_type.h:18