Files
@ r18290:4e805de55757
Branch filter:
Location: cpp/openttd-patchpack/source/src/ai/ai_scanner.hpp - annotation
r18290:4e805de55757
2.8 KiB
text/x-c++hdr
(svn r23136) -Change: [NewGRF v8] Deprecate old-style callback results 0xFF??.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | r10696:8dfe83e30d01 r10696:8dfe83e30d01 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r11380:8edd3e28a734 r14248:a9050881acd7 r10696:8dfe83e30d01 r15598:7c4c457ebe78 r15598:7c4c457ebe78 r15598:7c4c457ebe78 r11380:8edd3e28a734 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r17616:3ed8a6b01283 r17616:3ed8a6b01283 r17616:3ed8a6b01283 r17616:3ed8a6b01283 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r14187:fd7084a22bff r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r14377:f63ba65f9d57 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r17257:6860fed50c0e r10696:8dfe83e30d01 r10696:8dfe83e30d01 r16957:b73e503c5e41 r16957:b73e503c5e41 r16957:b73e503c5e41 r16957:b73e503c5e41 r16957:b73e503c5e41 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10840:7a608f4ad153 r10840:7a608f4ad153 r10840:7a608f4ad153 r10840:7a608f4ad153 r10840:7a608f4ad153 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10793:5ba2151e71e9 r13184:d87c98640532 r10793:5ba2151e71e9 r10696:8dfe83e30d01 r17616:3ed8a6b01283 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r16514:bf011466da17 r16514:bf011466da17 r16514:bf011466da17 r16514:bf011466da17 r16514:bf011466da17 r17616:3ed8a6b01283 r17616:3ed8a6b01283 r17616:3ed8a6b01283 r17616:3ed8a6b01283 r10696:8dfe83e30d01 r10696:8dfe83e30d01 r10696:8dfe83e30d01 | /* $Id$ */
/*
* 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_scanner.hpp declarations of the class for AI scanner */
#ifndef AI_SCANNER_HPP
#define AI_SCANNER_HPP
#include "../script/script_scanner.hpp"
#include "ai.hpp"
/**
* Class that scans for available AIs.
*/
class AIScanner : public ScriptScanner {
public:
AIScanner();
~AIScanner();
/**
* Import a library inside the Squirrel VM.
*/
bool ImportLibrary(const char *library, const char *class_name, int version, HSQUIRRELVM vm, class AIController *controller);
/**
* Register a library to be put in the available list.
*/
void RegisterLibrary(class AILibrary *library);
/**
* Register an AI to be put in the available list.
*/
void RegisterAI(class AIInfo *info);
/**
* Register the dummy AI.
* @param info The dummy AI that.
*/
void SetDummyAI(class AIInfo *info) { this->info_dummy = info; }
/**
* Select a Random AI.
*/
class AIInfo *SelectRandomAI() const;
/**
* Find an AI by name.
*/
class AIInfo *FindInfo(const char *name, int version, bool force_exact_match);
/**
* Get the list of available AIs for the console.
*/
char *GetAIConsoleList(char *p, const char *last, bool newest_only) const;
/**
* Get the list of available AI Libraries for the console.
*/
char *GetAIConsoleLibraryList(char *p, const char *last) const;
/**
* Get the list of all registered AIs.
*/
const AIInfoList *GetAIInfoList() { return &this->info_list; }
/**
* Get the list of the newest version of all registered AIs.
*/
const AIInfoList *GetUniqueAIInfoList() { return &this->info_single_list; }
/**
* Rescan the AI dir for scripts.
*/
void RescanAIDir();
#if defined(ENABLE_NETWORK)
bool HasAI(const struct ContentInfo *ci, bool md5sum);
#endif
private:
typedef std::map<const char *, class AILibrary *, StringCompare> AILibraryList; ///< Type for the list of libraries.
/**
* Scan the AI dir for scripts.
*/
void ScanAIDir();
/**
* Reset all allocated lists.
*/
void Reset();
AIInfo *info_dummy; ///< The dummy AI.
AIInfoList info_list; ///< The list of all AIs.
AIInfoList info_single_list; ///< The list of all unique AIs, based on shortname. The best AI (highest version) is shown.
AILibraryList library_list; ///< The list of libraries.
};
#endif /* AI_SCANNER_HPP */
|