Files
@ r28025:9116d6e411b0
Branch filter:
Location: cpp/openttd-patchpack/source/src/ai/ai_info.hpp - annotation
r28025:9116d6e411b0
2.3 KiB
text/x-c++hdr
Codechange: replace x.size() == 0 with x.empty()
r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r16851:b5784600e35e r16851:b5784600e35e r10696:8dfe83e30d01 r11380:8edd3e28a734 r10696:8dfe83e30d01 r15598:7c4c457ebe78 r18508:f893337ab5c7 r10696:8dfe83e30d01 r13879:b9c13f7998cb r10696:8dfe83e30d01 r10696:8dfe83e30d01 r18508:f893337ab5c7 r18508:f893337ab5c7 r18508:f893337ab5c7 r18508:f893337ab5c7 r18508:f893337ab5c7 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r15598:7c4c457ebe78 r15598:7c4c457ebe78 r15598:7c4c457ebe78 r15598:7c4c457ebe78 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r11118:0461c8a427c2 r11118:0461c8a427c2 r11119:63ffa1a1ddd6 r11118:0461c8a427c2 r11118:0461c8a427c2 r11720:a2a7bf20700e r11720:a2a7bf20700e r11720:a2a7bf20700e r11720:a2a7bf20700e r12738:a48207b124c5 r12738:a48207b124c5 r12738:a48207b124c5 r27352:2279f2687a7b r12738:a48207b124c5 r10696:8dfe83e30d01 r18510:9d33e9643f80 r18510:9d33e9643f80 r27352:2279f2687a7b r10696:8dfe83e30d01 r10696:8dfe83e30d01 r15598:7c4c457ebe78 r18508:f893337ab5c7 r10696:8dfe83e30d01 r27358:8ec8021bd4c2 r10758:7527fde7a84f r10696:8dfe83e30d01 r18508:f893337ab5c7 r18508:f893337ab5c7 r18508:f893337ab5c7 r18508:f893337ab5c7 r18508:f893337ab5c7 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r15598:7c4c457ebe78 r10758:7527fde7a84f r10758:7527fde7a84f r27358:8ec8021bd4c2 r10758:7527fde7a84f r10758:7527fde7a84f r27358:8ec8021bd4c2 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r16851:b5784600e35e | /*
* This file is part of OpenTTD.
* 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.
* 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.
* 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/>.
*/
/** @file ai_info.hpp AIInfo keeps track of all information of an AI, like Author, Description, ... */
#ifndef AI_INFO_HPP
#define AI_INFO_HPP
#include "../script/script_info.hpp"
/** All static information from an AI like name, version, etc. */
class AIInfo : public ScriptInfo {
public:
AIInfo();
/**
* Register the functions of this class.
*/
static void RegisterAPI(Squirrel *engine);
/**
* Create an AI, using this AIInfo as start-template.
*/
static SQInteger Constructor(HSQUIRRELVM vm);
/**
* Create a dummy-AI.
*/
static SQInteger DummyConstructor(HSQUIRRELVM vm);
/**
* Check if we can start this AI.
*/
bool CanLoadFromVersion(int version) const;
/**
* Use this AI as a random AI.
*/
bool UseAsRandomAI() const { return this->use_as_random; }
/**
* Get the API version this AI is written for.
*/
const std::string &GetAPIVersion() const { return this->api_version; }
private:
int min_loadable_version; ///< The AI can load savegame data if the version is equal or greater than this.
bool use_as_random; ///< Should this AI be used when the user wants a "random AI"?
std::string api_version; ///< API version used by this AI.
};
/** All static information from an AI library like name, version, etc. */
class AILibrary : public ScriptInfo {
public:
AILibrary() : ScriptInfo() {};
/**
* Register the functions of this class.
*/
static void RegisterAPI(Squirrel *engine);
/**
* Create an AI, using this AIInfo as start-template.
*/
static SQInteger Constructor(HSQUIRRELVM vm);
/**
* Get the category this library is in.
*/
const std::string &GetCategory() const { return this->category; }
private:
std::string category; ///< The category this library is in.
};
#endif /* AI_INFO_HPP */
|