Пример #1
0
 public void RemoveEntity(_Entity entity)
 {
     if (entity is Player)
     {
         player = null;
     }
     else if (entity is _Agent)
     {
         agent = null;
     }
     else if (entity is Thing)
     {
         thing = null;
     }
     else
     {
         throw new BadEntityException("Tried to remove " + entity.ToString() + " from " + ToString());
     }
 }
Пример #2
0
 public void AssignEntity(_Entity entity)
 {
     if (entity is Player)
     {
         player = (Player)entity;
     }
     else if (entity is _Agent)
     {
         agent = (_Agent)entity;
     }
     else if (entity is Thing)
     {
         thing = (Thing)entity;
     }
     else
     {
         throw new BadEntityException("Tried to assign " + entity.ToString() + " to " + ToString());
     }
 }