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/>.
10 /** @file game_scanner.hpp declarations of the class for Game scanner */
12 #ifndef GAME_SCANNER_HPP
13 #define GAME_SCANNER_HPP
15 #include "../script/script_scanner.hpp"
17 class GameScannerInfo
: public ScriptScanner
{
19 /* virtual */ void Initialize();
22 * Check if we have a game by name and version available in our list.
23 * @param nameParam The name of the game script.
24 * @param versionParam The version of the game script, or -1 if you want the latest.
25 * @param force_exact_match Only match name+version, never latest.
26 * @return NULL if no match found, otherwise the game script that matched.
28 class GameInfo
*FindInfo(const char *nameParam
, int versionParam
, bool force_exact_match
);
31 /* virtual */ void GetScriptName(ScriptInfo
*info
, char *name
, const char *last
);
32 /* virtual */ const char *GetFileName() const { return PATHSEP
"info.nut"; }
33 /* virtual */ Subdirectory
GetDirectory() const { return GAME_DIR
; }
34 /* virtual */ const char *GetScannerName() const { return "Game Scripts"; }
35 /* virtual */ void RegisterAPI(class Squirrel
*engine
);
39 class GameScannerLibrary
: public ScriptScanner
{
41 /* virtual */ void Initialize();
44 * Find a library in the pool.
45 * @param library The library name to find.
46 * @param version The version the library should have.
47 * @return The library if found, NULL otherwise.
49 class GameLibrary
*FindLibrary(const char *library
, int version
);
52 /* virtual */ void GetScriptName(ScriptInfo
*info
, char *name
, const char *last
);
53 /* virtual */ const char *GetFileName() const { return PATHSEP
"library.nut"; }
54 /* virtual */ Subdirectory
GetDirectory() const { return GAME_LIBRARY_DIR
; }
55 /* virtual */ const char *GetScannerName() const { return "GS Libraries"; }
56 /* virtual */ void RegisterAPI(class Squirrel
*engine
);
59 #endif /* GAME_SCANNER_HPP */