public BoardPositions Add(BoardPositions positions) { var sum = new List <BoardPosition>(Positions); sum.AddRange(positions.Positions); return(new BoardPositions(sum.Distinct().ToList())); }
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); }
public BoardPositions Substract(BoardPositions positions) { return(new BoardPositions(Positions.Except(positions.Positions).ToList())); }