aboutsummaryrefslogtreecommitdiff
path: root/src/main/game
diff options
context:
space:
mode:
authorCharlie Blake2018-07-10 23:03:10 +0100
committerCharlie Blake2018-07-10 23:03:10 +0100
commit00e1416edd74ad6cb32123020aa3b2ca115afb52 (patch)
tree1b27a6a3b6585ef33ebf9de68649f30ade4d3c26 /src/main/game
parentAdd Gaps integration tests (diff)
downloadmetasol-00e1416edd74ad6cb32123020aa3b2ca115afb52.tar.gz
metasol-00e1416edd74ad6cb32123020aa3b2ca115afb52.zip

Add deal parser json and fix bugs

Diffstat (limited to 'src/main/game')
-rw-r--r--src/main/game/sol_rules.cpp8
-rw-r--r--src/main/game/sol_rules.h9
2 files changed, 15 insertions, 2 deletions
diff --git a/src/main/game/sol_rules.cpp b/src/main/game/sol_rules.cpp
index d50d852..e9f4edf 100644
--- a/src/main/game/sol_rules.cpp
+++ b/src/main/game/sol_rules.cpp
@@ -7,6 +7,8 @@
typedef sol_rules::build_policy pol;
typedef sol_rules::spaces_policy s_pol;
typedef sol_rules::stock_deal_type sdt;
+typedef sol_rules::direction dir;
+typedef sol_rules::face_up_policy fu;
// Note that the 'default' sol rules are set up by parsing the default json
// rules description. This initialisation is really just for testing purposes.
@@ -28,5 +30,9 @@ sol_rules::sol_rules() :
stock_deal_t(sdt::TABLEAU_PILES),
stock_deal_count(1),
reserve_size(0),
- reserve_stacked(false) {
+ reserve_stacked(false),
+ face_up(fu::ALL),
+ sequence_count(0),
+ sequence_direction(dir::LEFT),
+ sequence_build_pol(pol::SAME_SUIT) {
}
diff --git a/src/main/game/sol_rules.h b/src/main/game/sol_rules.h
index 8075821..b03d854 100644
--- a/src/main/game/sol_rules.h
+++ b/src/main/game/sol_rules.h
@@ -32,6 +32,11 @@ struct sol_rules {
ALL,
TOP_CARDS
};
+ enum class direction {
+ LEFT,
+ RIGHT,
+ BOTH
+ };
uint8_t tableau_pile_count;
build_policy build_pol;
@@ -54,7 +59,9 @@ struct sol_rules {
uint8_t reserve_size;
bool reserve_stacked;
face_up_policy face_up;
-
+ uint8_t sequence_count;
+ direction sequence_direction;
+ build_policy sequence_build_pol;
};
#endif //SOLVITAIRE_SOL_RULES_H