My Project
Public Member Functions | Static Public Member Functions | List of all members
ParaEngine::CBootStrapper Class Reference

Bootstrapper file is a xml file to be executed at the very beginning of the game engine. More...

#include <BootStrapper.h>

Public Member Functions

bool LoadFromFile (const string &sXMLfile)
 load from a given XML file. More...
 
bool SaveToFile (const string &sXMLfile)
 save to a given XML file. More...
 
void LoadDefault ()
 load the default setting. More...
 
bool IsEmpty ()
 whether it is the default one. More...
 
const string & GetMainLoopFile ()
 get the game loop file. More...
 
void SetMainLoopFile (const string &sMainFile)
 Set the game loop file. More...
 
const string & GetConfigFile ()
 get the ParaEngine config file. More...
 
void SetConfigFile (const string &sConfigFile)
 set the ParaEngine config file. More...
 

Static Public Member Functions

static CBootStrapperGetSingleton ()
 since there is only one bootstrapper, it is always accessed through the singleton class. More...
 

Detailed Description

Bootstrapper file is a xml file to be executed at the very beginning of the game engine.

Its main function is to specify the main game loop file to be activated, and optionally the config file to load. Example: <verbatim> <?xml version="1.0" ?> <MainGameLoop>(gl)script/apps/Aries/main_loop.lua</MainGameLoop> <ConfigFile>config/config.safemode.txt</ConfigFile> </verbatim> Please note: ConfigFile is optional. We can specify a different config file other than config/config.txt to load at startup, such as safe mode.

Member Function Documentation

§ GetConfigFile()

const string & CBootStrapper::GetConfigFile ( )

get the ParaEngine config file.

The default is "", where the caller can default to config/config.txt

§ GetMainLoopFile()

const string & CBootStrapper::GetMainLoopFile ( )

get the game loop file.

the game loop file provides the heart beat of the application. It is also the very first(entry) script to be activated when the application starts up. The default game loop is ./script/gameinterface.lua

§ GetSingleton()

CBootStrapper * CBootStrapper::GetSingleton ( )
static

since there is only one bootstrapper, it is always accessed through the singleton class.

Returns

§ IsEmpty()

bool ParaEngine::CBootStrapper::IsEmpty ( )

whether it is the default one.

§ LoadDefault()

void CBootStrapper::LoadDefault ( )

load the default setting.

this function is called at the constructor.

§ LoadFromFile()

bool CBootStrapper::LoadFromFile ( const string &  sXMLfile)

load from a given XML file.

Parameters
sXMLfilethe path of the file, if this is "", the config/bootstrapper.xml will be used.
Returns
true if success

§ SaveToFile()

bool CBootStrapper::SaveToFile ( const string &  sXMLfile)

save to a given XML file.

Parameters
sXMLfilethe path of the file, if this is "", the config/bootstrapper.xml will be used.
Returns
true if success

Make xml: <?xml ..>

<MainGameLoop>script/gameinterface.lua</MainGameLoop>

§ SetConfigFile()

void CBootStrapper::SetConfigFile ( const string &  sConfigFile)

set the ParaEngine config file.

The default is "", where the caller can default to config/config.txt

§ SetMainLoopFile()

void CBootStrapper::SetMainLoopFile ( const string &  sMainFile)

Set the game loop file.

the game loop file provides the heart beat of the application. It is also the very first(entry) script to be activated when the application starts up. The default game loop is ./script/gameinterface.lua


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