diff --git a/Demo/Program.cs b/Demo/Program.cs index 3473e81..4f0bfa6 100644 --- a/Demo/Program.cs +++ b/Demo/Program.cs @@ -5,6 +5,7 @@ using RuleEngine.Dsl; // Parse arguments bool autoMode = args.Contains("--auto"); bool humanMode = args.Contains("--human"); +bool checkOnly = args.Contains("--check"); string dslPath = "dsl-examples/xuezhandaodi.yaml"; int dslIdx = Array.IndexOf(args, "--dsl"); if (dslIdx >= 0 && dslIdx + 1 < args.Length) @@ -64,6 +65,12 @@ catch (Exception ex) return 1; } +if (checkOnly) +{ + Console.WriteLine($"✅ 仅验证模式 — 未运行牌局"); + return 0; +} + if (autoMode) { // Batch mode: run N rounds silently diff --git a/README.md b/README.md index 29b164f..e08df16 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,10 @@ card-game-engine/ ## 用法 ```bash +# DSL 覆盖验证 (只加载不跑牌局) +dotnet run --project Demo -- --check --dsl your_variant +dotnet run --project Demo -- --check # 默认血战 + # 交互模式 (逐局展示) dotnet run --project Demo dotnet run --project Demo -- --dsl wuhan diff --git a/docs/dsl-specification.md b/docs/dsl-specification.md index 99084a8..9081f09 100644 --- a/docs/dsl-specification.md +++ b/docs/dsl-specification.md @@ -284,8 +284,21 @@ flower_rules: 4. 选择 `fan_types` (仅使用上表格中的番型名,其他名称得分为0) 5. 选择 `fan_stacking` 策略 6. 选择 `phases` 中的 actions (不列出=不可用) -7. 如果需要 wildcard/花牌/fu_flag,添加对应段 -8. 运行 `dotnet run --project Demo -- --dsl your_file --count 5` 验证 +7. 如果需要 wildcard/花牌/fu_flag/计分倍数,添加对应段 +8. **仅验证加载覆盖率** (不跑牌局): + ```bash + dotnet run --project Demo -- --check --dsl your_file + ``` + 输出示例: + ``` + ✅ DSL 适配率: 7/7 (100%) — 南昌麻将 + ✅ 仅验证模式 — 未运行牌局 + ``` + 如果有合规警告会在适配率下方显示 +9. **验证玩法可运行** (100 局压测): + ```bash + dotnet run --project Demo -- --dsl your_file --auto --count 100 + ``` ### 快速检查清单 - [ ] `deck.total` 与 `include_honors/include_flowers` 匹配