Example #1
0
        /// <summary>
        /// Terminate an entity by its UID
        /// </summary>
        /// <param name="pUID"></param>
        public void Terminate(int pUID)
        {
            // Find the entity that matches the passed pUID
            foreach (IEntity e in _entityList)
            {
                if (e.GetUID() == pUID)
                {
                    // set remove entity the entity that matches the pUID
                    _removeEntity = e;
                }
            }

            // if remove entity has a value
            if (_removeEntity != null)
            {
                // remove mind from the mindlist
                _AIComponentManager.RemoveMind(_removeEntity.GetMind());
                // remove entity from the sceneGraph
                _sceneGraph.Remove(_removeEntity.GetUID());
                // remove entity from the entity list
                _entityList.Remove(_removeEntity);
                // set the remove entity back to null after completion
                _removeEntity = null;
            }
        }
Example #2
0
 /// <summary>
 /// This is called when an entity needs to be removed.
 /// </summary>
 /// <param name="pUID"></param>
 public void Remove(int pUID)
 {
     _sceneGraph.Remove(pUID);
     _removeEntity = null;
 }
Example #3
0
 public void RemoveFromScene(IPositioned child)
 {
     _sceneGraph.Remove(child);
 }