- updated to add isGameOver

This commit is contained in:
Mark Vejvoda
2012-03-30 14:48:54 +00:00
parent c02c90427b
commit fa31fed5bd
3 changed files with 18 additions and 6 deletions

View File

@@ -315,6 +315,7 @@ void ScriptManager::init(World* world, GameCamera *gameCamera, const XmlNode *ro
luaScript.registerFunction(getUnitCount, "unitCount");
luaScript.registerFunction(getUnitCountOfType, "unitCountOfType");
luaScript.registerFunction(getIsGameOver, "isGameOver");
luaScript.registerFunction(getGameWon, "gameWon");
luaScript.registerFunction(getSystemMacroValue, "getSystemMacroValue");
@@ -1207,11 +1208,16 @@ int ScriptManager::getWorldFrameCount() {
return world->getFrameCount();
}
bool ScriptManager::getGameWon() {
bool ScriptManager::getGameWon() const {
ScriptManager_STREFLOP_Wrapper streflopWrapper;
return gameWon;
}
bool ScriptManager::getIsGameOver() const {
ScriptManager_STREFLOP_Wrapper streflopWrapper;
return gameOver;
}
int ScriptManager::getLastCreatedUnitId() {
if(SystemFlags::getSystemSettingType(SystemFlags::debugLUA).enabled) SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
ScriptManager_STREFLOP_Wrapper streflopWrapper;
@@ -2076,6 +2082,12 @@ int ScriptManager::getGameWon(LuaHandle* luaHandle){
return luaArguments.getReturnCount();
}
int ScriptManager::getIsGameOver(LuaHandle* luaHandle){
LuaArguments luaArguments(luaHandle);
luaArguments.returnInt(thisScriptManager->getIsGameOver());
return luaArguments.getReturnCount();
}
int ScriptManager::loadScenario(LuaHandle* luaHandle) {
LuaArguments luaArguments(luaHandle);
thisScriptManager->loadScenario(luaArguments.getString(-2),luaArguments.getInt(-1));