fix: CheckWin守卫!=14拒绝副露后手牌 + FullHand合并副露
根因: CheckWin要求tiles.Count==14,碰/杠后手牌只有11/8/5/2张 修复: - CheckWin守卫: !=14 → total%3!=2 (接受2,5,8,11,14) - FullHand(): 合并手牌+Exposed副露→虚拟完整手牌 - 所有CheckWin调用点改用FullHand (MahjongRoom+PhaseMachine+HumanMahjongPlayer) - 新增集成测试: 副露后11张手牌自摸
This commit is contained in:
@ -180,19 +180,21 @@ public class MahjongRoomIntegrationTests
|
||||
|
||||
// === Constructed win scenario ===
|
||||
[Fact]
|
||||
public void 构造听牌_庄家第一轮自摸()
|
||||
public void 构造听牌_副露后自摸()
|
||||
{
|
||||
var rules = LoadDsl("xuezhandaodi");
|
||||
var room = new MahjongRoom(rules, new[] { "东", "南", "西", "北" });
|
||||
room.Deal();
|
||||
|
||||
// 东 has a complete win: 123万 456万 789万 111条 99条
|
||||
room.State.Hands["东"] = new List<int> { 1,2,3,4,5,6,7,8,9,11,11,11,19,19 };
|
||||
// 东 already pung-ed 1万: exposed has {1,1,1}
|
||||
// Hand: 345万 888万 345条 88条 = 11 tiles → needs nothing, already winning
|
||||
room.State.Hands["东"] = new List<int> { 3,4,5, 8,8,8, 13,14,15, 18,18 };
|
||||
room.State.Exposed["东"] = new List<Meld> { new() { Type = "pung", Tiles = new() { 1,1,1 } } };
|
||||
room.State.DiscardPool = new List<int>();
|
||||
room.State.Deck = new List<int>();
|
||||
|
||||
room.StepTurn(); // dealer first turn, no draw, checks win
|
||||
room.StepTurn(); // dealer first turn, no draw, checks win with full hand
|
||||
|
||||
Assert.Contains("东", room.State.HuPlayers);
|
||||
Assert.True(room.State.AlivePlayers.Count < 4);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user