Beispiel #1
0
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();
}
Beispiel #2
0
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 );
}
Beispiel #3
0
void EditManager::editorDisabled()
{
   for(SimGroupIterator itr(Sim::getRootGroup());  *itr; ++itr)
   {
      SimObject *so = *itr;
      AssertFatal(so->isProperlyAdded() && !so->isRemoved(), "bad");
      so->onEditorDisable();
   }

   gEditingMission = false;
}
Beispiel #4
0
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 );
}