示例#1
0
        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
                   );
        }
示例#2
0
        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)
                   );
        }