My Project
|
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 CBootStrapper * | GetSingleton () |
since there is only one bootstrapper, it is always accessed through the singleton class. More... | |
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.
const string & CBootStrapper::GetConfigFile | ( | ) |
get the ParaEngine config file.
The default is "", where the caller can default to config/config.txt
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
|
static |
since there is only one bootstrapper, it is always accessed through the singleton class.
bool ParaEngine::CBootStrapper::IsEmpty | ( | ) |
whether it is the default one.
void CBootStrapper::LoadDefault | ( | ) |
load the default setting.
this function is called at the constructor.
bool CBootStrapper::LoadFromFile | ( | const string & | sXMLfile | ) |
load from a given XML file.
sXMLfile | the path of the file, if this is "", the config/bootstrapper.xml will be used. |
bool CBootStrapper::SaveToFile | ( | const string & | sXMLfile | ) |
save to a given XML file.
sXMLfile | the path of the file, if this is "", the config/bootstrapper.xml will be used. |
Make xml: <?xml ..>
<MainGameLoop>script/gameinterface.lua</MainGameLoop>
void CBootStrapper::SetConfigFile | ( | const string & | sConfigFile | ) |
set the ParaEngine config file.
The default is "", where the caller can default to config/config.txt
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