OpenTTD
game_info.hpp
Go to the documentation of this file.
1 /* $Id: game_info.hpp 23737 2012-01-03 20:37:56Z truebrain $ */
2 
3 /*
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/>.
8  */
9 
12 #ifndef GAME_INFO_HPP
13 #define GAME_INFO_HPP
14 
15 #include "../script/script_info.hpp"
16 
18 class GameInfo : public ScriptInfo {
19 public:
20  GameInfo();
21  ~GameInfo();
22 
26  static void RegisterAPI(Squirrel *engine);
27 
31  static SQInteger Constructor(HSQUIRRELVM vm);
32 
36  bool CanLoadFromVersion(int version) const;
37 
41  const char *GetAPIVersion() const { return this->api_version; }
42 
43  /* virtual */ bool IsDeveloperOnly() const { return this->is_developer_only; }
44 
45 private:
48  const char *api_version;
49 };
50 
52 class GameLibrary : public ScriptInfo {
53 public:
54  GameLibrary() : ScriptInfo(), category(NULL) {};
55  ~GameLibrary();
56 
60  static void RegisterAPI(Squirrel *engine);
61 
65  static SQInteger Constructor(HSQUIRRELVM vm);
66 
70  const char *GetCategory() const { return this->category; }
71 
72 private:
73  const char *category;
74 };
75 
76 #endif /* GAME_INFO_HPP */