From 77a7aeba7854d15b140cc6dc3c69b15ed5f3b936 Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Wed, 3 Jan 2018 12:30:14 +0000 Subject: Major refactor, putting pile logic into game_state Much of the logic that was in the pile class was beginning to seem out of place. A lot of the rules have fairly arbitrary interactons *between* piles, which weren't best represented in the pile classes themselves, which were getting unweildy and inefficient. Hence, much of this logic has been moved to the game state class. --- src/main/game/sol_rules.h | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 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 96c10d5..3d4995d 100644 --- a/src/main/game/sol_rules.h +++ b/src/main/game/sol_rules.h @@ -15,42 +15,22 @@ class sol_rules { public: - enum class valid_sol { - BLACK_HOLE, - SIMPLE_BLACK_HOLE, - SPANISH_PATIENCE, - SIMPLE_SPANISH_PATIENCE, - FREE_CELL, - SIMPLE_FREE_CELL, - CANFIELD, - SIMPLE_CANFIELD - }; + // Tableau policies enum class build_order { - NO_BUILD, DESCENDING, - ASCENDING, - BOTH, - SINGLE_CARD, - ANY + ASCENDING }; enum class build_policy { - CLUBS, - DIAMONDS, - HEARTS, - SPADES, - ANY_SUIT, + NO_BUILD, SAME_SUIT, RED_BLACK, - N_A + ANY_SUIT }; enum class spaces_policy { NO_BUILD, ANY }; - static bool is_suit(build_policy); - static card::suit_t suit_val(build_policy); - static const sol_rules from_preset(std::string); static const sol_rules from_file(std::string); @@ -62,15 +42,11 @@ public: bool hole; bool foundations; uint8_t cells; - uint8_t reserve_size; uint8_t stock_size; private: static sol_rules get_default(); static void modify_sol_rules(sol_rules&, rapidjson::Document&); - static void parse_err(const std::string&); - - static valid_sol valid_sol_enum(const std::string&); }; #endif //SOLVITAIRE_SOL_RULES_H -- cgit v1.2.1