Runtime information about a game script like a pointer to the squirrel vm and the current state. More...
#include <game_instance.hpp>
Public Member Functions | |
void | Initialize (class GameInfo *info) |
Initialize the script 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. |
Runtime information about a game script like a pointer to the squirrel vm and the current state.
Definition at line 18 of file game_instance.hpp.
ScriptInfo * GameInstance::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 195 of file game_instance.cpp.
int GameInstance::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 190 of file game_instance.cpp.
References GameConfig::GetConfig(), and ScriptConfig::GetSetting().
void GameInstance::Initialize | ( | class GameInfo * | info | ) |
Initialize the script and prepare it for its first run.
info | The GameInfo to start. |
Definition at line 88 of file game_instance.cpp.
References ScriptInstance::engine, ScriptInfo::GetInstanceName(), and ScriptInfo::GetMainScript().
Referenced by Game::StartNew().