13#include "../script/api/script_event_types.hpp"
31 static void StartNew(CompanyID company);
49 static void Stop(CompanyID company);
58 static void Pause(CompanyID company);
67 static void Unpause(CompanyID company);
75 static bool IsPaused(CompanyID company);
104 static void NewEvent(CompanyID company, ScriptEvent *event);
111 static void BroadcastNewEvent(ScriptEvent *event, CompanyID skip_company = CompanyID::Invalid());
117 static void Save(CompanyID company);
120 static void GetConsoleList(std::back_insert_iterator<std::string> &output_iterator,
bool newest_only);
122 static void GetConsoleLibraryList(std::back_insert_iterator<std::string> &output_iterator,
bool newest_only);
128 static class AIInfo *
FindInfo(
const std::string &name,
int version,
bool force_exact_match);
Declarations of the class for AI scanner.
All static information from an AI like name, version, etc.
All static information from an AI library like name, version, etc.
AI instantiation of a ScriptScanner.
AI instantiation of a ScriptScanner for libraries.
static uint GetTick()
Get the current AI tick.
static std::unique_ptr< AIScannerLibrary > scanner_library
ScriptScanner instance that is used to find AI Libraries.
static void GetConsoleLibraryList(std::back_insert_iterator< std::string > &output_iterator, bool newest_only)
Get the list of registered scripts to print on the console.
static void Uninitialize(bool keepConfig)
Uninitialize the AI system.
static AIScannerLibrary * GetScannerLibrary()
Gets the ScriptScanner instance that is used to find AI Libraries.
static void Pause(CompanyID company)
Suspend the AI and then pause execution of the script.
static void Initialize()
Initialize the AI system.
static bool HasAILibrary(const ContentInfo &ci, bool md5sum)
Check whether we have an AI library with the exact characteristics as ci.
static void GetConsoleList(std::back_insert_iterator< std::string > &output_iterator, bool newest_only)
Get the list of registered scripts to print on the console.
static void BroadcastNewEvent(ScriptEvent *event, CompanyID skip_company=CompanyID::Invalid())
Broadcast a new event to all active AIs.
static std::unique_ptr< AIScannerInfo > scanner_info
ScriptScanner instance that is used to find AIs.
static void GameLoop()
Called every game-tick to let AIs do something.
static bool CanStartNew()
Is it possible to start a new AI company?
static void StartNew(CompanyID company)
Start a new AI company.
static void Stop(CompanyID company)
Stop a company to be controlled by an AI.
static class AILibrary * FindLibrary(const std::string &library, int version)
Find a library.
static void ResetConfig()
Reset all AIConfigs, and make them reload their AIInfo.
static void NewEvent(CompanyID company, ScriptEvent *event)
Queue a new event for an AI.
static AIScannerInfo * GetScannerInfo()
Gets the ScriptScanner instance that is used to find AIs.
static const ScriptInfoList * GetUniqueInfoList()
Get the list of the latest version of all registered scripts.
static bool HasAI(const ContentInfo &ci, bool md5sum)
Wrapper function for AIScanner::HasAI.
static void Rescan()
Rescans all searchpaths for available AIs.
static uint frame_counter
Tick counter for the AI code.
static bool IsPaused(CompanyID company)
Checks if the AI is paused.
static void Save(CompanyID company)
Save data from an AI to a savegame.
static void Unpause(CompanyID company)
Resume execution of the AI.
static void KillAll()
Kill any and all AIs we manage.
static const ScriptInfoList * GetInfoList()
Get the list of all registered scripts.
static class AIInfo * FindInfo(const std::string &name, int version, bool force_exact_match)
Finds the appropriate ScriptInfo for a given script name and version.
std::map< std::string, class ScriptInfo *, CaseInsensitiveComparator > ScriptInfoList
Type for the list of scripts.
Container for all important information about a piece of content.