feat(计分): 实现血战计分V1核心逻辑
- 新增血战计分服务,支持七对、清一色等基础番型及杠上花等特殊加番 - 扩展结算结果结构,包含番型明细与支付分数计算 - 新增PostGangContext记录杠后补摸窗口,用于判断杠上花/杠上炮 - 完善胡牌判定器,新增七对和对对胡识别方法 - 更新开发计划文档,补充注释规范要求 - 添加计分相关单元测试,确保核心逻辑正确性
This commit is contained in:
@@ -2,6 +2,8 @@ package com.xuezhanmaster.game.event;
|
||||
|
||||
import com.xuezhanmaster.game.domain.ActionType;
|
||||
import com.xuezhanmaster.game.domain.ScoreChange;
|
||||
import com.xuezhanmaster.game.domain.SettlementDetail;
|
||||
import com.xuezhanmaster.game.domain.SettlementFan;
|
||||
import com.xuezhanmaster.game.domain.SettlementResult;
|
||||
import com.xuezhanmaster.game.domain.SettlementType;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -54,6 +56,12 @@ class GameEventTest {
|
||||
2,
|
||||
0,
|
||||
"9筒",
|
||||
new SettlementDetail(
|
||||
1,
|
||||
2,
|
||||
4,
|
||||
List.of(new SettlementFan("QING_YI_SE", "清一色", 2))
|
||||
),
|
||||
List.of(
|
||||
new ScoreChange(2, 1, 3),
|
||||
new ScoreChange(0, -1, -2)
|
||||
@@ -69,7 +77,12 @@ class GameEventTest {
|
||||
.containsEntry("actionType", "HU")
|
||||
.containsEntry("sourceSeatNo", 0)
|
||||
.containsEntry("triggerTile", "9筒");
|
||||
assertThat(settlementApplied.payload()).containsKey("settlementDetail");
|
||||
assertThat(settlementApplied.payload()).containsKey("scoreChanges");
|
||||
assertThat((java.util.Map<String, Object>) settlementApplied.payload().get("settlementDetail"))
|
||||
.containsEntry("baseScore", 1)
|
||||
.containsEntry("totalFan", 2)
|
||||
.containsEntry("paymentScore", 4);
|
||||
|
||||
assertThat(scoreChanged.eventType()).isEqualTo(GameEventType.SCORE_CHANGED);
|
||||
assertThat(scoreChanged.payload())
|
||||
|
||||
Reference in New Issue
Block a user