Browse Source

找服务接口

Administrator 2 months ago
parent
commit
28d9937b49
1 changed files with 14 additions and 0 deletions
  1. 14 0
      incubator-game/src/main/java/com/incubator/game/util/GDUtils.java

+ 14 - 0
incubator-game/src/main/java/com/incubator/game/util/GDUtils.java

@@ -1033,6 +1033,20 @@ public final class GDUtils {
         int minPreviousStraight = getMinStraightValue(adjustedPrevious);
         int minCurrentStraight = getMinStraightValue(adjustedCurrent);
 
+
+        // 判断是否为循环顺子(A-2-3-4-5)
+        boolean isPreviousCycle = isCycleStraight(adjustedPrevious);
+        boolean isCurrentCycle = isCycleStraight(adjustedCurrent);
+
+        // 如果上一手牌是循环顺子,当前牌不是循环顺子,则当前牌更大
+        if (isPreviousCycle && !isCurrentCycle) {
+            return 1;
+        }
+        // 如果当前牌是循环顺子,上一手牌不是循环顺子,则上一手牌更大
+        if (isCurrentCycle && !isPreviousCycle) {
+            return -1;
+        }
+
         // 如果当前顺子的最小点数较大,返回1
         if (minCurrentStraight > minPreviousStraight) {
             return 1;