Commit Graph

3 Commits

Author SHA1 Message Date
afce77cca4 [verified] review fixes: priority arbitration, wildcard config, dead code
- CheckReactions: collect all claims, pick highest priority (win>kong>pung>chi)
- Deal(): read wildcardCount from DSL config instead of hardcoded 4
- CheckTing(): propagate wildcardCount + require258Pair to CheckWin
- ThirteenOrphans: fix neededForPair formula (extra>0?0:1)
- Remove FanConfig.Get() dead code
- Fill empty 全不靠 test body
2026-07-03 18:02:13 +08:00
1346733996 [verified] fix: wildcard count correction in CheckWin tile count check
根因: CheckWin 开头 tiles.Count != 14 检查未计入 wildcardCount,
导致 12 tiles + 2 wildcards = 14 被误判为手牌不足。

修复: tiles.Count + wildcardCount != 14
同步修正鬼牌_1wildcard补刻子测试用13 tiles + 1 wildcard = 14

测试: 33/33 全部通过
2026-07-03 17:57:16 +08:00
3c6748bf06 [verified] feat: 麻将规则引擎 Demo 完整实现
RuleEngine 核心类:
- MahjongTile.cs — int编码 (1-29万条筒, 31-37字, 41-48花, 50-59宝牌)
- MeldsSolver.cs — 标准回溯 + wildcard缺口填充 + 七对/十三幺/全不靠
- PhaseMachine.cs — 回合机(摸打碰杠胡 + 优先级仲裁)
- ScoreEngine.cs — 番型计分 + 互斥图
- DslLoader.cs — YAML DSL加载 + 能力检查

4个DSL: 四川血战/广东鸡平胡/国标麻将/武汉麻将
控制台Demo: 交互模式 + 自动模式(--auto)
测试: 33个测试用例, 32个通过
2026-07-03 17:51:59 +08:00