Public Member Functions | Private Member Functions

GameInstance Class Reference

Runtime information about a game script like a pointer to the squirrel vm and the current state. More...

#include <game_instance.hpp>

Inheritance diagram for GameInstance:
ScriptInstance

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.

Detailed Description

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.


Member Function Documentation

ScriptInfo * GameInstance::FindLibrary ( const char *  library,
int  version 
) [virtual]

Find a library.

Parameters:
library The library name to find.
version The version the library should have.
Returns:
The library if found, NULL otherwise.

Implements ScriptInstance.

Definition at line 212 of file game_instance.cpp.

int GameInstance::GetSetting ( const char *  name  )  [virtual]

Get the value of a setting of the current instance.

Parameters:
name The name of the setting.
Returns:
the value for the setting, or -1 if the setting is not known.

Implements ScriptInstance.

Definition at line 207 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.

Parameters:
info The GameInfo to start.

Definition at line 93 of file game_instance.cpp.

References ScriptInstance::engine, GameInfo::GetAPIVersion(), ScriptInfo::GetInstanceName(), ScriptInfo::GetMainScript(), and ScriptInstance::versionAPI.

Referenced by Game::StartNew().


The documentation for this class was generated from the following files: