Runtime information about an AI like a pointer to the squirrel vm and the current state. More...
#include <ai_instance.hpp>
Public Member Functions | |
void | Initialize (class AIInfo *info) |
Initialize the AI and prepare it for its first run. | |
int | GetSetting (const char *name) |
Get the value of a setting of the current instance. | |
ScriptInfo * | FindLibrary (const char *library, int version) |
Find a library. | |
Private Member Functions | |
void | RegisterAPI () |
Register all API functions to the VM. | |
void | Died () |
Tell the script it died. | |
CommandCallback * | GetDoCommandCallback () |
Get the callback handling DoCommands in case of networking. | |
void | LoadDummyScript () |
Load the dummy script. | |
bool | LoadCompatibilityScripts (const char *api_version) |
Load squirrel scripts to emulate an older API. | |
Private Attributes | |
const char * | versionAPI |
Current API used by this script. |
Runtime information about an AI like a pointer to the squirrel vm and the current state.
Definition at line 19 of file ai_instance.hpp.
ScriptInfo * AIInstance::FindLibrary | ( | const char * | library, | |
int | version | |||
) | [virtual] |
Find a library.
library | The library name to find. | |
version | The version the library should have. |
Implements ScriptInstance.
Definition at line 247 of file ai_instance.cpp.
int AIInstance::GetSetting | ( | const char * | name | ) | [virtual] |
Get the value of a setting of the current instance.
name | The name of the setting. |
Implements ScriptInstance.
Definition at line 242 of file ai_instance.cpp.
References _current_company, AIConfig::GetConfig(), and AIConfig::GetSetting().
void AIInstance::Initialize | ( | class AIInfo * | info | ) |
Initialize the AI and prepare it for its first run.
info | The AI to create the instance of. |
Definition at line 90 of file ai_instance.cpp.
References ScriptInstance::engine, AIInfo::GetAPIVersion(), ScriptInfo::GetInstanceName(), ScriptInfo::GetMainScript(), and versionAPI.
Referenced by AI::StartNew().