public bool TileInDirectionIsFree(int row, int col, MoveDirection direction) { int newRow = row + MoveUtil.GetRowMoveAmountByColor(Piece.Owner, direction); int newCol = col + MoveUtil.GetColMoveAmount(direction); return(CheckerBoard.TileIsInBounds(newRow, newCol) && Board.GetPiece(newRow, newCol) == null ); }
public bool TileCanBeJumpedInDirection(int row, int col, MoveDirection direction) { int jumpRow = row + MoveUtil.GetRowMoveAmountByColor(Piece.Owner, direction); int jumpCol = col + MoveUtil.GetColMoveAmount(direction); return(CheckerBoard.TileIsInBounds(jumpRow, jumpCol) && TileInDirectionIsFree(jumpRow, jumpCol, direction) && Board.TileIsOpposingColor(jumpRow, jumpCol, OpposingColor) ); }