summaryrefslogtreecommitdiff
path: root/src/game/game_info.hpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-19 20:56:59 +0000
committertruebrain <truebrain@openttd.org>2011-12-19 20:56:59 +0000
commit963802e9a7cb67f51cb7e6ffe9d33a02cfe93821 (patch)
treed8b2d5c1c2d90c7cb1a02403cea942ab52c2e501 /src/game/game_info.hpp
parent83f2785f54de1c31267c5586464c97fb39f95b5a (diff)
downloadopenttd-963802e9a7cb67f51cb7e6ffe9d33a02cfe93821.tar.xz
(svn r23612) -Add: allow importing libraries in the same way as AI does, only with GS prefix (and in game/library)
Diffstat (limited to 'src/game/game_info.hpp')
-rw-r--r--src/game/game_info.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/game/game_info.hpp b/src/game/game_info.hpp
index e476e8e9c..8fe588dd0 100644
--- a/src/game/game_info.hpp
+++ b/src/game/game_info.hpp
@@ -46,4 +46,29 @@ private:
const char *api_version; ///< API version used by this Game.
};
+/** All static information from an Game library like name, version, etc. */
+class GameLibrary : public ScriptInfo {
+public:
+ GameLibrary() : ScriptInfo(), category(NULL) {};
+ ~GameLibrary();
+
+ /**
+ * Register the functions of this class.
+ */
+ static void RegisterAPI(Squirrel *engine);
+
+ /**
+ * Create an GSLibrary, using this GSInfo as start-template.
+ */
+ static SQInteger Constructor(HSQUIRRELVM vm);
+
+ /**
+ * Get the category this library is in.
+ */
+ const char *GetCategory() const { return this->category; }
+
+private:
+ const char *category; ///< The category this library is in.
+};
+
#endif /* GAME_INFO_HPP */