Ejemplo n.º 1
0
        public BoardPositions Add(BoardPositions positions)
        {
            var sum = new List <BoardPosition>(Positions);

            sum.AddRange(positions.Positions);
            return(new BoardPositions(sum.Distinct().ToList()));
        }
Ejemplo n.º 2
0
        public Board(int height, int width)
        {
            Height = height;
            Width  = width;
            var positions = new List <BoardPosition>();

            for (int y = 0; y < Height; y++)
            {
                for (int x = 0; x < Width; x++)
                {
                    positions.Add(new BoardPosition(x, y));
                }
            }
            Positions = new BoardPositions(positions);
        }
Ejemplo n.º 3
0
 public BoardPositions Substract(BoardPositions positions)
 {
     return(new BoardPositions(Positions.Except(positions.Positions).ToList()));
 }