public bool IsSquareEmpty(Square square) { return(board[square.Row, square.Col] == null); }
public Piece GetPiece(Square square) { return(board[square.Row, square.Col]); }
public bool IsPositionValid(Square square) { return(square.Row >= 0 && square.Row < GameSettings.BoardSize && square.Col >= 0 && square.Col < GameSettings.BoardSize); }
public bool Equals(Square other) { return(Row == other.Row && Col == other.Col); }
public void AddPiece(Square square, Piece pawn) { board[square.Row, square.Col] = pawn; }
public bool SquareHasEnemy(Square square, Player player) { return(square.IsValid() && GetPiece(square) != null && GetPiece(square).Player != player); }
public AvailableMoves(Square current) { Squares = new List <Square>(); Current = current; }
public bool SquareHasFriendly(Square square, Player player) { return(square.IsValid() && GetPiece(square) != null && GetPiece(square).Player == player); }
public bool SquareIsOccupied(Square square) { return(square.IsValid() && GetPiece(square) != null); }
public bool SquareIsEmpty(Square square) { return(square.IsValid() && GetPiece(square) == null); }
public bool IsValidCapture(int row, int col) { return(row < GameSettings.BoardSize && row >= 0 && col < GameSettings.BoardSize && col >= 0 && (GetPiece(Square.At(row, col)) == null || GetPiece(Square.At(row, col)).Player != CurrentPlayer)); }
public bool IsValidPosition(int row, int col) { return(row < GameSettings.BoardSize && row >= 0 && col < GameSettings.BoardSize && col >= 0 && GetPiece(Square.At(row, col)) == null); }