OpenTTD
game_scanner.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_SCANNER_HPP
11 #define GAME_SCANNER_HPP
12 
13 #include "../script/script_scanner.hpp"
14 
16 public:
17  void Initialize() override;
18 
26  class GameInfo *FindInfo(const char *nameParam, int versionParam, bool force_exact_match);
27 
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;
34 };
35 
36 
38 public:
39  void Initialize() override;
40 
47  class GameLibrary *FindLibrary(const char *library, int version);
48 
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;
55 };
56 
57 #endif /* GAME_SCANNER_HPP */
int version
Version of the script.
Subdirectory
The different kinds of subdirectories OpenTTD uses.
Definition: fileio_type.h:108
class GameInfo * FindInfo(const char *nameParam, int versionParam, bool force_exact_match)
Check if we have a game by name and version available in our list.
Subdirectory for all game scripts.
Definition: fileio_type.h:121
All static information from an Game like name, version, etc.
Definition: game_info.hpp:16
Subdirectory GetDirectory() const override
Get the directory to scan in.
void RegisterAPI(class Squirrel *engine) override
Register the API for this ScriptInfo.
Subdirectory GetDirectory() const override
Get the directory to scan in.
Scanner to help finding scripts.
All static information from an Game library like name, version, etc.
Definition: game_info.hpp:50
All static information from an Script like name, version, etc.
Definition: script_info.hpp:30
Subdirectory for all GS libraries.
Definition: fileio_type.h:122
const char * GetFileName() const override
Get the filename to scan for this type of script.
const char * name
Full name of the script.
const char * GetScannerName() const override
Get the type of the script, in plural.
const char * GetScannerName() const override
Get the type of the script, in plural.
void GetScriptName(ScriptInfo *info, char *name, const char *last) override
Get the script name how to store the script in memory.
class Squirrel * engine
The engine we&#39;re scanning with.
const char * GetFileName() const override
Get the filename to scan for this type of script.