Add: Draw network password indicator lock in company drop down list. (#7079)
[openttd-github.git] / src / ai / ai_config.hpp
blobb02935902c060d104f315a28ea7a2da933cc5e3b
1 /* $Id$ */
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
10 /** @file ai_config.hpp AIConfig stores the configuration settings of every AI. */
12 #ifndef AI_CONFIG_HPP
13 #define AI_CONFIG_HPP
15 #include "../script/script_config.hpp"
16 #include "../company_type.h"
18 class AIConfig : public ScriptConfig {
19 public:
20 /**
21 * Get the config of a company.
23 static AIConfig *GetConfig(CompanyID company, ScriptSettingSource source = SSS_DEFAULT);
25 AIConfig() :
26 ScriptConfig()
29 AIConfig(const AIConfig *config) :
30 ScriptConfig(config)
33 class AIInfo *GetInfo() const;
35 /* virtual */ int GetSetting(const char *name) const;
36 /* virtual */ void SetSetting(const char *name, int value);
38 /**
39 * When ever the AI Scanner is reloaded, all infos become invalid. This
40 * function tells AIConfig about this.
41 * @param force_exact_match If true try to find the exact same version
42 * as specified. If false any version is ok.
43 * @return \c true if the reset was successful, \c false if the AI was no longer
44 * found.
46 bool ResetInfo(bool force_exact_match);
48 protected:
49 /* virtual */ void PushExtraConfigList();
50 /* virtual */ void ClearConfigList();
51 /* virtual */ ScriptInfo *FindInfo(const char *name, int version, bool force_exact_match);
54 #endif /* AI_CONFIG_HPP */