OpenTTD Source: src/game/game_config.hpp Source File

OpenTTD Source 14.1

game_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 GAME_CONFIG_HPP
11 #define GAME_CONFIG_HPP
12
13 #include "../script/script_config.hpp"
14
15 class GameConfig : public ScriptConfig {
16 public:
20 static GameConfig *GetConfig(ScriptSettingSource source = SSS_DEFAULT);
21
22 GameConfig() :
23 ScriptConfig()
24 {}
25
26 GameConfig(const GameConfig *config) :
27 ScriptConfig(config)
28 {}
29
30 class GameInfo *GetInfo() const;
31
40 bool ResetInfo(bool force_exact_match);
41
42 protected:
43 ScriptInfo *FindInfo(const std::string &name, int version, bool force_exact_match) override;
44 };
45
46 #endif /* GAME_CONFIG_HPP */
ScriptConfig::SSS_DEFAULT
@ SSS_DEFAULT
Get the Script config from the current game mode.
Definition: script_config.hpp:95
GameConfig
Definition: game_config.hpp:15
ScriptConfig::version
int version
Version of the Script.
Definition: script_config.hpp:175
GameConfig::FindInfo
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: game_config.cpp:35
GameConfig::ResetInfo
bool ResetInfo(bool force_exact_match)
When ever the Game Scanner is reloaded, all infos become invalid.
Definition: game_config.cpp:40
GameConfig::GetConfig
static GameConfig * GetConfig(ScriptSettingSource source=SSS_DEFAULT)
Get the config of a company.
Definition: game_config.cpp:18
ScriptConfig
Script settings.
Definition: script_config.hpp:49
GameInfo
All static information from an Game like name, version, etc.
Definition: game_info.hpp:16
ScriptConfig::name
std::string name
Name of the Script.
Definition: script_config.hpp:174
ScriptInfo
All static information from an Script like name, version, etc.
Definition: script_info.hpp:30
ScriptConfig::ScriptSettingSource
ScriptSettingSource
Where to get the config from, either default (depends on current game mode) or force either newgame o...
Definition: script_config.hpp:94