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:
@ -27,7 +27,12 @@ public class MeldsSolver
|
||||
{
|
||||
var tiles = new List<int>(hand);
|
||||
if (newTile.HasValue) tiles.Add(newTile.Value);
|
||||
if (tiles.Count + wildcardCount != 14) return new MeldsResult { IsWin = false };
|
||||
|
||||
// Standard mahjong hand: 4 melds (3 tiles each) + 1 pair (2 tiles) = 14 tiles
|
||||
// With exposed melds, hand has fewer tiles. Valid counts: 2,5,8,11,14
|
||||
int total = tiles.Count + wildcardCount;
|
||||
if (total < 2 || total % 3 != 2 || total > 14)
|
||||
return new MeldsResult { IsWin = false };
|
||||
|
||||
tiles.Sort();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user