예제 #1
0
        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));
        }
예제 #2
0
 public Entity RemoveAlly(Position pos)
 {
     return(Allies.ContainsKey(pos) ? UpdateWith(allies: Allies.Remove(pos)) : this);
 }