summaryrefslogtreecommitdiff
path: root/src/game/game.hpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-19 20:55:56 +0000
committertruebrain <truebrain@openttd.org>2011-12-19 20:55:56 +0000
commitc99950c21537f9c890e4eac6d077c0ec6f31b7aa (patch)
treec130b8aa9cf12c7c3a1c9ef014bb35df3f53035f /src/game/game.hpp
parentb4f832f29f44dcd48e8f0806d47ce78b1963d639 (diff)
downloadopenttd-c99950c21537f9c890e4eac6d077c0ec6f31b7aa.tar.xz
(svn r23606) -Add: GameScanner, to auto-detect game scripts, and wire it in the console
Diffstat (limited to 'src/game/game.hpp')
-rw-r--r--src/game/game.hpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/game/game.hpp b/src/game/game.hpp
index de9e8213c..363682797 100644
--- a/src/game/game.hpp
+++ b/src/game/game.hpp
@@ -12,6 +12,12 @@
#ifndef GAME_HPP
#define GAME_HPP
+#include "../core/string_compare_type.hpp"
+#include <map>
+
+/** A list that maps AI names to their AIInfo object. */
+typedef std::map<const char *, class ScriptInfo *, StringCompare> ScriptInfoList;
+
/**
* Main Game class. Contains all functions needed to start, stop, save and load Game Scripts.
*/
@@ -30,16 +36,30 @@ public:
/**
* Uninitialize the Game system.
*/
- static void Uninitialize();
+ static void Uninitialize(bool keepConfig);
/**
* Get the current GameScript instance.
*/
static class GameInstance *GetGameInstance() { return Game::instance; }
+ static void Rescan();
+ static void ResetConfig();
+
+ /** Wrapper function for GameScanner::GetConsoleList */
+ static char *GetConsoleList(char *p, const char *last, bool newest_only = false);
+ /** Wrapper function for GameScanner::GetInfoList */
+ static const ScriptInfoList *GetInfoList();
+ /** Wrapper function for GameScanner::GetUniqueInfoList */
+ static const ScriptInfoList *GetUniqueInfoList();
+ /** Wrapper function for GameScannerInfo::FindInfo */
+ static class GameInfo *FindInfo(const char *name, int version, bool force_exact_match);
+
private:
- static uint frame_counter; ///< Tick counter for the Game code.
- static class GameInstance *instance; ///< Instance to the current active Game.
+ static uint frame_counter; ///< Tick counter for the Game code.
+ static class GameInstance *instance; ///< Instance to the current active Game.
+ static class GameScannerInfo *scanner; ///< Scanner for Game scripts.
+ static class GameInfo *info; ///< Current selected GameInfo.
};
#endif /* GAME_HPP */