Add: INR currency (#8136)
[openttd-github.git] / src / game / game_scanner.hpp
blob6c96bccfdff3e684517527ba3272ab151893aa81
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 */
8 /** @file game_scanner.hpp declarations of the class for Game scanner */
10 #ifndef GAME_SCANNER_HPP
11 #define GAME_SCANNER_HPP
13 #include "../script/script_scanner.hpp"
15 class GameScannerInfo : public ScriptScanner {
16 public:
17 void Initialize() override;
19 /**
20 * Check if we have a game by name and version available in our list.
21 * @param nameParam The name of the game script.
22 * @param versionParam The version of the game script, or -1 if you want the latest.
23 * @param force_exact_match Only match name+version, never latest.
24 * @return nullptr if no match found, otherwise the game script that matched.
26 class GameInfo *FindInfo(const char *nameParam, int versionParam, bool force_exact_match);
28 protected:
29 void GetScriptName(ScriptInfo *info, char *name, const char *last) override;
30 const char *GetFileName() const override { return PATHSEP "info.nut"; }
31 Subdirectory GetDirectory() const override { return GAME_DIR; }
32 const char *GetScannerName() const override { return "Game Scripts"; }
33 void RegisterAPI(class Squirrel *engine) override;
37 class GameScannerLibrary : public ScriptScanner {
38 public:
39 void Initialize() override;
41 /**
42 * Find a library in the pool.
43 * @param library The library name to find.
44 * @param version The version the library should have.
45 * @return The library if found, nullptr otherwise.
47 class GameLibrary *FindLibrary(const char *library, int version);
49 protected:
50 void GetScriptName(ScriptInfo *info, char *name, const char *last) override;
51 const char *GetFileName() const override { return PATHSEP "library.nut"; }
52 Subdirectory GetDirectory() const override { return GAME_LIBRARY_DIR; }
53 const char *GetScannerName() const override { return "GS Libraries"; }
54 void RegisterAPI(class Squirrel *engine) override;
57 #endif /* GAME_SCANNER_HPP */