示例#1
0
 public bool ContainsOpposingPiece(Square square, Player currentPlayer)
 {
     if (IsSquareEmpty(square) || !square.IsValid())
     {
         return(false);
     }
     else
     {
         return(GetPiece(square).Player != currentPlayer);
     }
 }
示例#2
0
 public bool IsSquareEmpty(Square testSquare)
 {
     if (testSquare.IsValid())
     {
         return(GetPiece(testSquare) == null);
     }
     else
     {
         return(false);
     }
 }
示例#3
0
 public bool SquareHasEnemy(Square square, Player player)
 {
     return(square.IsValid() && GetPiece(square) != null && GetPiece(square).Player != player);
 }
示例#4
0
 public bool SquareHasFriendly(Square square, Player player)
 {
     return(square.IsValid() && GetPiece(square) != null && GetPiece(square).Player == player);
 }
示例#5
0
 public bool SquareIsOccupied(Square square)
 {
     return(square.IsValid() && GetPiece(square) != null);
 }
示例#6
0
 public bool SquareIsEmpty(Square square)
 {
     return(square.IsValid() && GetPiece(square) == null);
 }