00001 /* $Id$ */ 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 #include "../script/script_config.hpp" 00017 00019 class GameInfo : public ScriptInfo { 00020 public: 00021 GameInfo(); 00022 ~GameInfo(); 00023 00027 static void RegisterAPI(Squirrel *engine); 00028 00032 static SQInteger Constructor(HSQUIRRELVM vm); 00033 00037 bool CanLoadFromVersion(int version) const; 00038 00042 const char *GetAPIVersion() const { return this->api_version; } 00043 00044 /* virtual */ bool IsDeveloperOnly() const { return this->is_developer_only; } 00045 00046 private: 00047 int min_loadable_version; 00048 bool is_developer_only; 00049 const char *api_version; 00050 }; 00051 00053 class GameLibrary : public ScriptInfo { 00054 public: 00055 GameLibrary() : ScriptInfo(), category(NULL) {}; 00056 ~GameLibrary(); 00057 00061 static void RegisterAPI(Squirrel *engine); 00062 00066 static SQInteger Constructor(HSQUIRRELVM vm); 00067 00071 const char *GetCategory() const { return this->category; } 00072 00073 private: 00074 const char *category; 00075 }; 00076 00077 #endif /* GAME_INFO_HPP */