From 28c5a79425fa12f9466e27385404f429f76f7524 Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Thu, 19 Jul 2018 11:06:38 +0100 Subject: Update rules so new schema works w/ existing games --- src/main/game/sol_rules.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/main/game/sol_rules.h') diff --git a/src/main/game/sol_rules.h b/src/main/game/sol_rules.h index 0673771..25dcbe4 100644 --- a/src/main/game/sol_rules.h +++ b/src/main/game/sol_rules.h @@ -44,17 +44,27 @@ struct sol_rules { RIGHT, BOTH }; + enum class built_group_type { + YES, + NO, + WHOLE_PILE + }; + enum class foundations_init_type { + NONE, + ONE, + ALL + }; uint8_t tableau_pile_count; build_policy build_pol; spaces_policy spaces_pol; - bool move_built_group; + built_group_type move_built_group; build_policy built_group_pol; bool two_decks; uint8_t max_rank; bool hole; bool foundations_present; - bool foundations_init_card; + foundations_init_type foundations_init_cards; bool foundations_removable; bool foundations_only_comp_piles; bool diagonal_deal; -- cgit v1.2.1 From 2775a9ba0ef4e698acd0c0d32179d6a1e404297a Mon Sep 17 00:00:00 2001 From: Charlie Blake Date: Thu, 19 Jul 2018 16:16:39 +0100 Subject: Add parsing of new rules --- src/main/game/sol_rules.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/game/sol_rules.h') diff --git a/src/main/game/sol_rules.h b/src/main/game/sol_rules.h index 25dcbe4..2384b21 100644 --- a/src/main/game/sol_rules.h +++ b/src/main/game/sol_rules.h @@ -7,7 +7,9 @@ #include #include +#include +#include "card.h" #include "../../../lib/rapidjson/document.h" struct sol_rules { @@ -23,7 +25,8 @@ struct sol_rules { enum class spaces_policy { NO_BUILD, KINGS, - ANY + ANY, + AUTO_RESERVE_THEN_WASTE }; enum class accordion_policy { SAME_RANK, @@ -60,11 +63,13 @@ struct sol_rules { spaces_policy spaces_pol; built_group_type move_built_group; build_policy built_group_pol; + bool tableau_wraps; bool two_decks; uint8_t max_rank; bool hole; bool foundations_present; foundations_init_type foundations_init_cards; + boost::optional foundations_base; bool foundations_removable; bool foundations_only_comp_piles; bool diagonal_deal; -- cgit v1.2.1