示例#1
0
 public bool IsSquareEmpty(Square square)
 {
     return(board[square.Row, square.Col] == null);
 }
示例#2
0
 public Piece GetPiece(Square square)
 {
     return(board[square.Row, square.Col]);
 }
示例#3
0
 public bool IsPositionValid(Square square)
 {
     return(square.Row >= 0 && square.Row < GameSettings.BoardSize &&
            square.Col >= 0 && square.Col < GameSettings.BoardSize);
 }
示例#4
0
 public bool Equals(Square other)
 {
     return(Row == other.Row && Col == other.Col);
 }
示例#5
0
 public void AddPiece(Square square, Piece pawn)
 {
     board[square.Row, square.Col] = pawn;
 }
示例#6
0
 public bool SquareHasEnemy(Square square, Player player)
 {
     return(square.IsValid() && GetPiece(square) != null && GetPiece(square).Player != player);
 }
示例#7
0
 public AvailableMoves(Square current)
 {
     Squares = new List <Square>();
     Current = current;
 }
示例#8
0
 public bool SquareHasFriendly(Square square, Player player)
 {
     return(square.IsValid() && GetPiece(square) != null && GetPiece(square).Player == player);
 }
示例#9
0
 public bool SquareIsOccupied(Square square)
 {
     return(square.IsValid() && GetPiece(square) != null);
 }
示例#10
0
 public bool SquareIsEmpty(Square square)
 {
     return(square.IsValid() && GetPiece(square) == null);
 }
示例#11
0
 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));
 }
示例#12
0
 public bool IsValidPosition(int row, int col)
 {
     return(row < GameSettings.BoardSize && row >= 0 && col < GameSettings.BoardSize && col >= 0 &&
            GetPiece(Square.At(row, col)) == null);
 }