00001 /* $Id: game_scanner.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_SCANNER_HPP 00013 #define GAME_SCANNER_HPP 00014 00015 #include "../script/script_scanner.hpp" 00016 00017 class GameScannerInfo : public ScriptScanner { 00018 public: 00019 /* virtual */ void Initialize(); 00020 00028 class GameInfo *FindInfo(const char *nameParam, int versionParam, bool force_exact_match); 00029 00030 protected: 00031 /* virtual */ void GetScriptName(ScriptInfo *info, char *name, int len); 00032 /* virtual */ const char *GetFileName() const { return PATHSEP "info.nut"; } 00033 /* virtual */ Subdirectory GetDirectory() const { return GAME_DIR; } 00034 /* virtual */ const char *GetScannerName() const { return "Game Scripts"; } 00035 /* virtual */ void RegisterAPI(class Squirrel *engine); 00036 }; 00037 00038 00039 class GameScannerLibrary : public ScriptScanner { 00040 public: 00041 /* virtual */ void Initialize(); 00042 00049 class GameLibrary *FindLibrary(const char *library, int version); 00050 00051 protected: 00052 /* virtual */ void GetScriptName(ScriptInfo *info, char *name, int len); 00053 /* virtual */ const char *GetFileName() const { return PATHSEP "library.nut"; } 00054 /* virtual */ Subdirectory GetDirectory() const { return GAME_LIBRARY_DIR; } 00055 /* virtual */ const char *GetScannerName() const { return "GS Libraries"; } 00056 /* virtual */ void RegisterAPI(class Squirrel *engine); 00057 }; 00058 00059 #endif /* GAME_SCANNER_HPP */