diff options
| author | Charlie Blake | 2017-12-31 11:53:50 +0000 |
|---|---|---|
| committer | GitHub | 2017-12-31 11:53:50 +0000 |
| commit | 22e8b69a830d3e61be83762b9f1e6ce97bd3ec1e (patch) | |
| tree | faa726d97fcde3ea236f46e0c2b2d77a68f4cd9f /src/main/game/sol_rules.h | |
| parent | Merge pull request #26 from thecharlesblake/deal-description-and-test (diff) | |
| parent | Remove need for default switch in compile flags (diff) | |
| download | metasol-22e8b69a830d3e61be83762b9f1e6ce97bd3ec1e.tar.gz metasol-22e8b69a830d3e61be83762b9f1e6ce97bd3ec1e.zip | |
Merge pull request #27 from thecharlesblake/efficient-implementation
Efficient implementation
Diffstat (limited to 'src/main/game/sol_rules.h')
| -rw-r--r-- | src/main/game/sol_rules.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/main/game/sol_rules.h b/src/main/game/sol_rules.h index 17dd74a..a2f8fe9 100644 --- a/src/main/game/sol_rules.h +++ b/src/main/game/sol_rules.h @@ -11,6 +11,8 @@ #include <boost/optional.hpp> #include <rapidjson/document.h> +#include "card.h" + class sol_rules { public: enum class valid_sol { @@ -28,7 +30,8 @@ public: DESCENDING, ASCENDING, BOTH, - SINGLE_CARD + SINGLE_CARD, + ANY }; enum class build_policy { CLUBS, @@ -37,24 +40,25 @@ public: SPADES, ANY_SUIT, SAME_SUIT, - RED_BLACK + RED_BLACK, + N_A }; + static bool is_suit(build_policy); + static card::suit_t suit_val(build_policy); + static const sol_rules from_preset(const std::string); static const sol_rules from_file(const std::string); - static bool is_suit(build_policy); - static int suit_val(build_policy); - - unsigned int tableau_pile_count; + uint8_t tableau_pile_count; build_order build_ord; build_policy build_pol; - unsigned int max_rank; + card::rank_t max_rank; bool hole; bool foundations; - unsigned int cells; - unsigned int reserve_size; - unsigned int stock_size; + uint8_t cells; + uint8_t reserve_size; + uint8_t stock_size; private: static sol_rules get_default(); |
