void SimGroup::popObject() { MutexHandle handle; handle.lock( mMutex ); if( objectList.empty() ) { AssertWarn( false, "SimGroup::popObject - Stack underflow" ); return; } SimObject* object = objectList.last(); objectList.pop_back(); object->onGroupRemove(); object->mGroup = NULL; clearNotify( object ); mNameDictionary.remove( object ); getSetModificationSignal().trigger( SetObjectAdded, this, object ); if( object->isProperlyAdded() ) onObjectRemoved_callback( object ); object->decRefCount(); }
void SimGroup::clear() { lock(); while( size() > 0 ) { SimObject* object = objectList.last(); object->onGroupRemove(); objectList.pop_back(); mNameDictionary.remove( object ); object->mGroup = 0; getSetModificationSignal().trigger( SetObjectRemoved, this, object ); if( object->isProperlyAdded() ) onObjectRemoved_callback( object ); if( engineAPI::gUseConsoleInterop ) object->deleteObject(); else object->decRefCount(); } unlock(); getSetModificationSignal().trigger( SetCleared, this, NULL ); }
void EditManager::editorDisabled() { for(SimGroupIterator itr(Sim::getRootGroup()); *itr; ++itr) { SimObject *so = *itr; AssertFatal(so->isProperlyAdded() && !so->isRemoved(), "bad"); so->onEditorDisable(); } gEditingMission = false; }
void SimSet::popObject() { if( objectList.empty() ) { AssertWarn(false, "Stack underflow in SimSet::popObject"); return; } lock(); SimObject* object = objectList.last(); objectList.pop_back(); clearNotify( object ); unlock(); getSetModificationSignal().trigger( SetObjectRemoved, this, object ); if( object->isProperlyAdded() ) onObjectRemoved_callback( object ); }