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