public Entity RemoveAll(Position pos) { ImmutableDictionary <Position, int> tmpo = Obstacles, tmpe = Enemies, tmpa = Allies; if (Obstacles.ContainsKey(pos)) { tmpo = Obstacles.Remove(pos); } if (Enemies.ContainsKey(pos)) { tmpe = Enemies.Remove(pos); } if (Allies.ContainsKey(pos)) { tmpa = Allies.Remove(pos); } return(UpdateWith(allies: tmpa, obstacles: tmpo, enemies: tmpe)); }
public Entity RemoveAlly(Position pos) { return(Allies.ContainsKey(pos) ? UpdateWith(allies: Allies.Remove(pos)) : this); }