15 #include "../script/api/script_event_types.hpp" 16 #include "../core/string_compare_type.hpp" 21 typedef std::map<const char *, class ScriptInfo *, StringCompare>
ScriptInfoList;
36 START_NEXT_MAX = 3600,
37 START_NEXT_DEVIATION = 60,
144 static char *
GetConsoleList(
char *p,
const char *last,
bool newest_only =
false);
167 #if defined(ENABLE_NETWORK) 170 static bool HasAILibrary(
const ContentInfo *ci,
bool md5sum);
static void StartNew(CompanyID company, bool rerandomise_ai=true)
Start a new AI company.
static const int DAYS_IN_YEAR
days per year
static const ScriptInfoList * GetInfoList()
Wrapper function for AIScanner::GetAIInfoList.
static void Unpause(CompanyID company)
Resume execution of the AI.
static char * GetConsoleList(char *p, const char *last, bool newest_only=false)
Wrapper function for AIScanner::GetAIConsoleList.
std::map< const char *, class ScriptInfo *, StringCompare > ScriptInfoList
A list that maps AI names to their AIInfo object.
static bool IsPaused(CompanyID company)
Checks if the AI is paused.
static void Pause(CompanyID company)
Suspend the AI and then pause execution of the script.
static AIScannerLibrary * GetScannerLibrary()
Gets the ScriptScanner instance that is used to find AI Libraries.
static void Initialize()
Initialize the AI system.
static void BroadcastNewEvent(ScriptEvent *event, CompanyID skip_company=MAX_COMPANIES)
Broadcast a new event to all active AIs.
static int GetStartNextTime()
Get the number of days before the next AI should start.
static class AIInfo * FindInfo(const char *name, int version, bool force_exact_match)
Wrapper function for AIScanner::FindInfo.
declarations of the class for AI scanner
StartNext
The default months AIs start after each other.
static void Save(CompanyID company)
Save data from an AI to a savegame.
static uint GetTick()
Get the current AI tick.
static void ResetConfig()
Reset all AIConfigs, and make them reload their AIInfo.
static void GameLoop()
Called every game-tick to let AIs do something.
static void Uninitialize(bool keepConfig)
Uninitialize the AI system.
All static information from an AI library like name, version, etc.
static void Load(CompanyID company, int version)
Load data for an AI from a savegame.
static void Stop(CompanyID company)
Stop a company to be controlled by an AI.
Maximum number of companies.
static bool HasAI(const struct ContentInfo *ci, bool md5sum)
Wrapper function for AIScanner::HasAI.
static void NewEvent(CompanyID company, ScriptEvent *event)
Queue a new event for an AI.
const char * name
Full name of the script.
All static information from an AI like name, version, etc.
static class AIScannerLibrary * scanner_library
ScriptScanner instance that is used to find AI Libraries.
static uint frame_counter
Tick counter for the AI code.
static void KillAll()
Kill any and all AIs we manage.
static void Rescan()
Rescans all searchpaths for available AIs.
static class AILibrary * FindLibrary(const char *library, int version)
Wrapper function for AIScanner::FindLibrary.
static const ScriptInfoList * GetUniqueInfoList()
Wrapper function for AIScanner::GetUniqueAIInfoList.
static char * GetConsoleLibraryList(char *p, const char *last)
Wrapper function for AIScanner::GetAIConsoleLibraryList.
static bool CanStartNew()
Is it possible to start a new AI company?
Owner
Enum for all companies/owners.
static class AIScannerInfo * scanner_info
ScriptScanner instance that is used to find AIs.
static AIScannerInfo * GetScannerInfo()
Gets the ScriptScanner instance that is used to find AIs.
Container for all important information about a piece of content.