OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

ai_scanner.hpp
Go to the documentation of this file.
1 /* $Id: ai_scanner.hpp 26487 2014-04-23 21:16:58Z rubidium $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
9
12 #ifndef AI_SCANNER_HPP
13 #define AI_SCANNER_HPP
14
15 #include "../script/script_scanner.hpp"
16
17 class AIScannerInfo : public ScriptScanner {
18 public:
19 AIScannerInfo();
20 ~AIScannerInfo();
21
22 /* virtual */ void Initialize();
23
28 class AIInfo *SelectRandomAI() const;
29
37 class AIInfo *FindInfo(const char *nameParam, int versionParam, bool force_exact_match);
38
42 void SetDummyAI(class AIInfo *info);
43
44 protected:
45 /* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last);
46 /* virtual */ const char *GetFileName() const { return PATHSEP "info.nut"; }
47 /* virtual */ Subdirectory GetDirectory() const { return AI_DIR; }
48 /* virtual */ const char *GetScannerName() const { return "AIs"; }
49 /* virtual */ void RegisterAPI(class Squirrel *engine);
50
51 private:
52 AIInfo *info_dummy;
53 };
54
55 class AIScannerLibrary : public ScriptScanner {
56 public:
57 /* virtual */ void Initialize();
58
65 class AILibrary *FindLibrary(const char *library, int version);
66
67 protected:
68 /* virtual */ void GetScriptName(ScriptInfo *info, char *name, const char *last);
69 /* virtual */ const char *GetFileName() const { return PATHSEP "library.nut"; }
70 /* virtual */ Subdirectory GetDirectory() const { return AI_LIBRARY_DIR; }
71 /* virtual */ const char *GetScannerName() const { return "AI Libraries"; }
72 /* virtual */ void RegisterAPI(class Squirrel *engine);
73 };
74
75 #endif /* AI_SCANNER_HPP */