diff options
| author | thecharlesblake | 2018-01-08 18:59:44 +0000 |
|---|---|---|
| committer | thecharlesblake | 2018-01-08 18:59:44 +0000 |
| commit | cc5cb4243d2015f218ed5258df47ec678175a486 (patch) | |
| tree | be3cfdf0919c0556ca7d17794a785720414074f4 /src/main/input-output/input | |
| parent | Add unit tests for alpha star (diff) | |
| download | metasol-cc5cb4243d2015f218ed5258df47ec678175a486.tar.gz metasol-cc5cb4243d2015f218ed5258df47ec678175a486.zip | |
Add rules parsing for built pile (AS)
Diffstat (limited to 'src/main/input-output/input')
| -rw-r--r-- | src/main/input-output/input/json-parsing/rules_parser.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/main/input-output/input/json-parsing/rules_parser.cpp b/src/main/input-output/input/json-parsing/rules_parser.cpp index 9d20a5a..9ec2339 100644 --- a/src/main/input-output/input/json-parsing/rules_parser.cpp +++ b/src/main/input-output/input/json-parsing/rules_parser.cpp @@ -126,6 +126,22 @@ void rules_parser::modify_sol_rules(sol_rules& sr, Document& d) { } } + if (d["tableau piles"].HasMember("move built group")) { + if (d["tableau piles"]["move built group"].IsBool()) { + sr.move_built_group = d["tableau piles"]["move built group"].GetBool(); + } else { + json_helper::json_parse_err("[tableau piles][move built group] must be a boolean"); + } + } + + if (d["tableau piles"].HasMember("diagonal deal")) { + if (d["tableau piles"]["diagonal deal"].IsBool()) { + sr.diagonal_deal = d["tableau piles"]["diagonal deal"].GetBool(); + } else { + json_helper::json_parse_err("[tableau piles][diagonal deal] must be a boolean"); + } + } + } else { json_helper::json_parse_err("[tableau piles] must be an object"); } @@ -163,14 +179,6 @@ void rules_parser::modify_sol_rules(sol_rules& sr, Document& d) { } } - if (d.HasMember("diagonal deal")) { - if (d["diagonal deal"].IsBool()) { - sr.diagonal_deal = d["diagonal deal"].GetBool(); - } else { - json_helper::json_parse_err("[diagonal deal] must be a boolean"); - } - } - if (d.HasMember("cells")) { if (d["cells"].IsInt()) { sr.cells = static_cast<uint8_t>(d["cells"].GetInt()); |
