void Application::onRelease() { ScriptUnregisterFunction( TWindowManager::GetInstance()->GetScript(), "addGame" ); ScriptUnregisterFunction( TWindowManager::GetInstance()->GetScript(), "addLevel" ); ScriptUnregisterFunction( TWindowManager::GetInstance()->GetScript(), "addActor" ); releaseLuaFunction( 0 ); releaseLuaFunction( 1 ); getFactory()->release(); Factory* factory( getFactory() ); setFactory( 0 ); delete factory; Game* game = begin(); while(game) { if ( game->isInited() ) { game->release(); } game=getNextEntity(); } removeAllEntity(); }
void Application::onInit() { removeAllEntity(); setFactory( new Factory() ); getFactory()->init( TWindowManager::GetInstance()->GetScript(), this ); ScriptRegisterMemberDirect( TWindowManager::GetInstance()->GetScript(),"addGame", this, Application::addGame ); ScriptRegisterMemberDirect( TWindowManager::GetInstance()->GetScript(),"addLevel", this, Application::addLevel ); ScriptRegisterMemberDirect( TWindowManager::GetInstance()->GetScript(),"addActor", this, Application::addActor ); initLuaFunction( 0, "onInit" ); initLuaFunction( 1, "onCreateLevelTable" ); executeLuaFunction( 0 ); }
Loader::params &Loader::params::operator= (const Loader::params &other) { if (this != &other) { // protect against invalid self-assignment if (Input != nullptr) delete Input; if (Header != nullptr) delete Header; Input = other.getInput()->clone(); Header = other.getHeader()->clone(); setBasePath(other.getBasePath()); setFactory(other.getFactory()); setInsertOnly(other.getInsertOnly()); setReturnsMutableVerticalTable(other.getReturnsMutableVerticalTable()); setModifiableMutableVerticalTable(other.getModifiableMutableVerticalTable()); setCompressed(other.getCompressed()); setReferenceTable(other.getReferenceTable()); } // by convention, always return *this return *this; }
CertificateHandlerFactoryMgr::CertificateHandlerFactoryMgr() { setFactory("ConsoleCertificateHandler", new CertificateHandlerFactoryImpl<ConsoleCertificateHandler>()); setFactory("AcceptCertificateHandler", new CertificateHandlerFactoryImpl<AcceptCertificateHandler>()); }
void Application::initPlayground(TPlatform* pPlatform) { setFactory( 0 ); initGameStates(); initWindows(pPlatform); }
ProjectImpl::ProjectImpl() { mFlowFile = NULL; mMode = pmAncient; setFactory(factLexicalAnalyer, new LexerFactory); }