fix: CheckWin守卫wildcard重复计数 + 人类HUD集成对手出牌

Critical: 固定wildcard(紅中)在tiles列表中又被wildcardCount计数
→ tiles中14张(含1張紅中)+wildcardCount(1)=15, 15%3=0≠2→拒绝胡
修复: 守卫减去tiles中已含的wildcard数

UX: 对手出牌直接嵌入人类HUD
→ 例: 对手: AI-南:10张 出:1万3条5筒 | AI-西:13张
This commit is contained in:
xiaoou
2026-07-04 17:46:21 +08:00
parent eb22f6ee28
commit a047877494
2 changed files with 21 additions and 1 deletions

View File

@ -30,7 +30,10 @@ public class MeldsSolver
// 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;
// Fixed wildcards (e.g. 紅中) are IN the tiles list but skipped by BuildCounts.
// Only count non-wildcard tiles for the guard.
int wildcardsInTiles = tiles.Count(MahjongTile.IsWildcard);
int total = tiles.Count - wildcardsInTiles + wildcardCount;
if (total < 2 || total % 3 != 2 || total > 14)
return new MeldsResult { IsWin = false };