OpenTTD Source 20260218-master-g2123fca5ea
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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
9
10#ifndef GAME_CONFIG_HPP
11#define GAME_CONFIG_HPP
12
14
16class GameConfig : public ScriptConfig {
17public:
23 static GameConfig *GetConfig(ScriptSettingSource source = SSS_DEFAULT);
24
25 GameConfig() :
26 ScriptConfig()
27 {}
28
33 GameConfig(const GameConfig &config) :
34 ScriptConfig(config)
35 {}
36
38 class GameInfo *GetInfo() const;
39
48 bool ResetInfo(bool force_exact_match);
49
50protected:
51 ScriptInfo *FindInfo(const std::string &name, int version, bool force_exact_match) override;
52};
53
54#endif /* GAME_CONFIG_HPP */
ScriptInfo * FindInfo(const std::string &name, int version, bool force_exact_match) override
Finds the appropriate ScriptInfo for a given script name and version.
bool ResetInfo(bool force_exact_match)
When ever the Game Scanner is reloaded, all infos become invalid.
static GameConfig * GetConfig(ScriptSettingSource source=SSS_DEFAULT)
Get the script configuration.
class GameInfo * GetInfo() const
Get the ScriptInfo linked to this ScriptConfig.
GameConfig(const GameConfig &config)
Copy constructor.
All static information from an Game like name, version, etc.
Definition game_info.hpp:16
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.
ScriptConfig stores the configuration settings of every Script.