[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
This commit is contained in:
xiaoou
2026-07-03 18:02:13 +08:00
parent 1346733996
commit afce77cca4
3 changed files with 69 additions and 43 deletions

View File

@ -9,8 +9,6 @@ public class FanConfig
public int Level { get; set; }
public List<string> Excludes { get; set; } = new();
public List<string> Conflicts { get; set; } = new();
public FanConfig Get(string name) => throw new NotImplementedException("Use dictionary lookup");
}
public class MeldsSolver
@ -377,12 +375,9 @@ public class MeldsSolver
int unique = PopCount(present);
int missing = 13 - unique;
// Need: enough wildcards to fill missing tiles + 1 more for the duplicate
// Need wildcards for: missing unique tiles + 1 for the pair (if no duplicate exists)
int neededForMissing = missing;
// Extra: we need 14 tiles = 13 unique + 1 duplicate
// If extra > 0, we already have the duplicate
// If extra == 0 and wildcards cover missing + 1 for pair
int neededForPair = (extra > 0 || missing > 0) ? 0 : 1;
int neededForPair = extra > 0 ? 0 : 1; // duplicate already present → no pair wildcard needed
int totalNeeded = neededForMissing + neededForPair;
if (totalNeeded <= wildcardCount)