aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/game/sol_rules.h1
-rw-r--r--src/main/input-output/input/json-parsing/rules_parser.cpp8
2 files changed, 9 insertions, 0 deletions
diff --git a/src/main/game/sol_rules.h b/src/main/game/sol_rules.h
index 5c7713c..11f169f 100644
--- a/src/main/game/sol_rules.h
+++ b/src/main/game/sol_rules.h
@@ -39,6 +39,7 @@ struct sol_rules {
uint8_t cells;
uint8_t stock_size;
uint8_t reserve_size;
+ bool reserve_stacked;
};
#endif //SOLVITAIRE_SOL_RULES_H
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 cc893fa..f997ba3 100644
--- a/src/main/input-output/input/json-parsing/rules_parser.cpp
+++ b/src/main/input-output/input/json-parsing/rules_parser.cpp
@@ -186,4 +186,12 @@ void rules_parser::modify_sol_rules(sol_rules& sr, Document& d) {
json_helper::json_parse_err("[reserve size] must be an integer");
}
}
+
+ if (d.HasMember("reserve stacked")) {
+ if (d["reserve stacked"].IsBool()) {
+ sr.reserve_stacked = d["reserve stacked"].GetBool();
+ } else {
+ json_helper::json_parse_err("[reserve stacked] must be a boolean");
+ }
+ }
}