OpenTTD
ai_info.hpp
Go to the documentation of this file.
1 /* $Id: ai_info.hpp 23735 2012-01-03 20:26:05Z 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_INFO_HPP
13 #define AI_INFO_HPP
14 
15 #include "../script/script_info.hpp"
16 
18 class AIInfo : public ScriptInfo {
19 public:
20  AIInfo();
21  ~AIInfo();
22 
26  static void RegisterAPI(Squirrel *engine);
27 
31  static SQInteger Constructor(HSQUIRRELVM vm);
32 
36  static SQInteger DummyConstructor(HSQUIRRELVM vm);
37 
41  bool CanLoadFromVersion(int version) const;
42 
46  bool UseAsRandomAI() const { return this->use_as_random; }
47 
51  const char *GetAPIVersion() const { return this->api_version; }
52 
53 private:
56  const char *api_version;
57 };
58 
60 class AILibrary : public ScriptInfo {
61 public:
62  AILibrary() : ScriptInfo(), category(NULL) {};
63  ~AILibrary();
64 
68  static void RegisterAPI(Squirrel *engine);
69 
73  static SQInteger Constructor(HSQUIRRELVM vm);
74 
78  const char *GetCategory() const { return this->category; }
79 
80 private:
81  const char *category;
82 };
83 
84 #endif /* AI_INFO_HPP */