ai_scanner.hpp

Go to the documentation of this file.
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 AI_SCANNER_HPP
00013 #define AI_SCANNER_HPP
00014 
00015 #include "../script/script_scanner.hpp"
00016 #include "../core/string_compare_type.hpp"
00017 #include <map>
00018 
00019 class AIScanner : public ScriptScanner {
00020 public:
00021   AIScanner();
00022   ~AIScanner();
00023 
00027   bool ImportLibrary(const char *library, const char *class_name, int version, HSQUIRRELVM vm, class AIController *controller);
00028 
00032   void RegisterLibrary(class AILibrary *library);
00033 
00037   void RegisterAI(class AIInfo *info);
00038 
00039   void SetDummyAI(class AIInfo *info) { this->info_dummy = info; }
00040 
00044   class AIInfo *SelectRandomAI();
00045 
00049   class AIInfo *FindInfo(const char *name, int version);
00050 
00054   char *GetAIConsoleList(char *p, const char *last);
00055 
00059   const AIInfoList *GetAIInfoList() { return &this->info_list; }
00060 
00064   const AIInfoList *GetUniqueAIInfoList() { return &this->info_single_list; }
00065 
00069   void RescanAIDir();
00070 
00071 #if defined(ENABLE_NETWORK)
00072   bool HasAI(const struct ContentInfo *ci, bool md5sum);
00073 #endif
00074 private:
00075   typedef std::map<const char *, class AILibrary *, StringCompare> AILibraryList;
00076 
00080   void ScanAIDir();
00081 
00082   AIInfo *info_dummy;
00083   AIInfoList info_list;
00084   AIInfoList info_single_list;
00085   AILibraryList library_list;
00086 };
00087 
00088 #endif /* AI_SCANNER_HPP */

Generated on Sat Dec 26 20:05:58 2009 for OpenTTD by  doxygen 1.5.6