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()); } }
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()); } }