WSL::Framework::Standard::Base::BaseEntity* WSL::DataTranslation::EntityTranslator::Instantiate( std::string standardScripts[], std::vector< std::string > otherScripts, unsigned int size, bool initialize, bool refresh, bool destroy, bool destroyed, int objectID, WSL::Engine *engine ) { WSL::Framework::Standard::Base::Entity* temp = new WSL::Framework::Standard::Base::Entity( objectID, refresh, destroyed, initialize, destroy, standardScripts[ 1 ], standardScripts[ 0 ], standardScripts[ 2 ], standardScripts[ 3 ], engine ); temp->SendSelf = SendObject; unsigned int i = 0; if( size != 0 ) { while( i < size ) { temp->SetRefrence( engine ); BaseSend(); { WSL::Framework::Standard::Base::BaseEntity* base = &*temp; SendToLua( base, engine ); } temp->RunScript( otherScripts[ i ] ); temp->DeleteRefrence(); i++; } } WSL::Framework::Standard::Base::BaseEntity* base = &*temp; return base; }
void WSL::Singleton::LevelCycle() { bool break_ = false; unsigned int c = 0; unsigned int size = levels.Array.size(); input->refrence = engine; if( size != 0 ) { while( c < size && break_ == false ) { if( levels.Array[c]->active == true ) { if( levels.Array[c]->destroy == true ) { unsigned int objectSize = objects.Array.size(); for( unsigned int i = 0; i < objects.Array.size()/*objectSize*/ && break_ == false; i++ ) { if( levels.Array[c]->ObjectIsInLevel( i ) == true ) { if( HeartBeat( i ) == -1 && objects.Array.size() != 1 && i > 0 ) --objectSize; } } WSL::Algorithmic::Level *temp = levels.Array[c]; temp->SetRefrence( this ); BaseSend(); unsigned int clear = temp->SendRenderLayer(); luabind::globals( engine->luaContainer->State )[ temp->name ] = temp; temp->Destroy(); temp->DeleteRefrence(); WSL::Algorithmic::RenderLayer *r = renderLayers.Array[clear]; r->DeleteRefrence(); temp->DeleteRenderLayer(); levels.Delete( c ); delete temp; size -= 1; } else { if( levels.Array[c]->refresh == true ) { unsigned int objectSize = objects.Array.size(); for( unsigned int i = 0; i < objects.Array.size()/*objectSize*/ && break_ == false; i++ ) { if( levels.Array[c]->ObjectIsInLevel( i ) == true ) { if( HeartBeat( i ) == -1 && objects.Array.size() != 1 && i > 0 ) --objectSize; } } if( levels.Array[c]->refreshScript != "NULL" ) { BaseSend(); levels.Array[c]->SetRefrence( this ); unsigned int clear = levels.Array[c]->SendRenderLayer(); luabind::globals( engine->luaContainer->State )[ levels.Array[c]->name ] = levels.Array[c]; levels.Array[c]->Refresh(); levels.Array[c]->DeleteRefrence(); renderLayers.Array[clear]->DeleteRefrence(); } } } } //Tee-hee// c++; } } }