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); }
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()); }
public IEnumerable <Square> GetSquares() { return(_squares.Cast <Square>()); }