diff options
author | truebrain <truebrain@openttd.org> | 2011-12-19 20:56:59 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-12-19 20:56:59 +0000 |
commit | 963802e9a7cb67f51cb7e6ffe9d33a02cfe93821 (patch) | |
tree | d8b2d5c1c2d90c7cb1a02403cea942ab52c2e501 /src/game/game_scanner.hpp | |
parent | 83f2785f54de1c31267c5586464c97fb39f95b5a (diff) | |
download | openttd-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_scanner.hpp')
-rw-r--r-- | src/game/game_scanner.hpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/game/game_scanner.hpp b/src/game/game_scanner.hpp index bf6701221..8f43d145c 100644 --- a/src/game/game_scanner.hpp +++ b/src/game/game_scanner.hpp @@ -16,8 +16,6 @@ class GameScannerInfo : public ScriptScanner { public: - GameScannerInfo(); - /* virtual */ void Initialize(); /** @@ -37,4 +35,25 @@ protected: /* virtual */ void RegisterAPI(class Squirrel *engine); }; + +class GameScannerLibrary : public ScriptScanner { +public: + /* virtual */ void Initialize(); + + /** + * Find a library in the pool. + * @param library The library name to find. + * @param version The version the library should have. + * @return The library if found, NULL otherwise. + */ + class GameLibrary *FindLibrary(const char *library, int version); + +protected: + /* virtual */ void GetScriptName(ScriptInfo *info, char *name, int len); + /* virtual */ const char *GetFileName() const { return PATHSEP "library.nut"; } + /* virtual */ Subdirectory GetDirectory() const { return GAME_LIBRARY_DIR; } + /* virtual */ const char *GetScannerName() const { return "GS Libraries"; } + /* virtual */ void RegisterAPI(class Squirrel *engine); +}; + #endif /* GAME_SCANNER_HPP */ |