Exemple #1
0
 public Board(Square[,] squares)
 {
     Squares     = squares;
     WhitePieces = Squares.Cast <Square>().Count(s => !s.IsEmpty && s.Piece.Color == Color.White);
     BlackPieces = Squares.Cast <Square>().Count(s => !s.IsEmpty && s.Piece.Color == Color.Black);
 }
Exemple #2
0
        public bool IsSquareUnrevealed(Coordinate coordinate)
        {
            var squares = _boardSquares.Cast <Square>().ToList();

            return(squares.Any(s => s.Coordinate.X == coordinate.X && s.Coordinate.Y == coordinate.Y && s.IsRevealed == false));
        }
 public IEnumerator <Square> GetEnumerator()
 {
     return(_grid.Cast <Square>().GetEnumerator());
 }
Exemple #4
0
 public IEnumerable <Square> GetSquares()
 {
     return(_squares.Cast <Square>());
 }