00001 /* $Id: game_info.hpp 23737 2012-01-03 20:37:56Z truebrain $ */ 00002 00003 /* 00004 * This file is part of OpenTTD. 00005 * 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. 00006 * 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. 00007 * 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/>. 00008 */ 00009 00012 #ifndef GAME_INFO_HPP 00013 #define GAME_INFO_HPP 00014 00015 #include "../script/script_info.hpp" 00016 00018 class GameInfo : public ScriptInfo { 00019 public: 00020 GameInfo(); 00021 ~GameInfo(); 00022 00026 static void RegisterAPI(Squirrel *engine); 00027 00031 static SQInteger Constructor(HSQUIRRELVM vm); 00032 00036 bool CanLoadFromVersion(int version) const; 00037 00041 const char *GetAPIVersion() const { return this->api_version; } 00042 00043 /* virtual */ bool IsDeveloperOnly() const { return this->is_developer_only; } 00044 00045 private: 00046 int min_loadable_version; 00047 bool is_developer_only; 00048 const char *api_version; 00049 }; 00050 00052 class GameLibrary : public ScriptInfo { 00053 public: 00054 GameLibrary() : ScriptInfo(), category(NULL) {}; 00055 ~GameLibrary(); 00056 00060 static void RegisterAPI(Squirrel *engine); 00061 00065 static SQInteger Constructor(HSQUIRRELVM vm); 00066 00070 const char *GetCategory() const { return this->category; } 00071 00072 private: 00073 const char *category; 00074 }; 00075 00076 #endif /* GAME_INFO_HPP */