Example #1
0
 /// <summary>
 /// Adds a new entity and removes any nodes from the graph that collide
 /// with this entity
 /// </summary>
 public void AddCollidingEntity(Entity newEntity)
 {
     if (!_entitiesReadOnly)
     {
         _entities.Add(newEntity);
     }
     else
     {
         _addable.Add(newEntity);
     }
     _graph.RemoveEdgesFor(newEntity);
 }
Example #2
0
 /// <summary>
 /// Add a new entity to keep track of.
 /// </summary>
 public void AddEntity(Entity newEntity)
 {
     if (!_entitiesReadOnly)
     {
         _entities.Add(newEntity);
     }
     else
     {
         _addable.Add(newEntity);
     }
 }
Example #3
0
 public void RemoveEntity(Entity entity)
 {
     if (!_entitiesReadOnly)
     {
         _entities.Remove(entity);
     }
     else
     {
         _removable.Add(entity);
     }
 }
Example #4
0
 /// <summary>
 /// Construct a steering behavior that seeks the specified target.
 /// </summary>
 public FleeSteering(Entity target)
 {
     this._target = target;
     this._seekAtSteering = new SeekAtSteering();
 }