diff options
| author | thecharlesblake | 2017-11-07 10:19:41 +0000 |
|---|---|---|
| committer | thecharlesblake | 2017-11-11 11:07:35 +0000 |
| commit | 31d05fec2003736e20d05a16c8abdebcd5d5fbf3 (patch) | |
| tree | 00546e2d9c6567a557998180762e47e5683ad031 /src | |
| parent | Add Canfield cmdln arg and enum (diff) | |
| download | metasol-31d05fec2003736e20d05a16c8abdebcd5d5fbf3.tar.gz metasol-31d05fec2003736e20d05a16c8abdebcd5d5fbf3.zip | |
Add Canfield game rules
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/sol_rules.cpp | 16 | ||||
| -rw-r--r-- | src/main/sol_rules.h | 6 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/main/sol_rules.cpp b/src/main/sol_rules.cpp index 7010af1..b3b5457 100644 --- a/src/main/sol_rules.cpp +++ b/src/main/sol_rules.cpp @@ -46,10 +46,13 @@ sol_rules::sol_rules(std::string sol_type) { // Default game values build_ord = build_order::DESCENDING; + build_pol = build_policy::ANY_SUIT; max_rank = 13; hole = false; foundations = true; cells = 0; + reserve_size = 0; + stock_size = 0; // Game-specific values switch(vs) { @@ -83,6 +86,19 @@ sol_rules::sol_rules(std::string sol_type) { max_rank = 3; cells = 1; break; + case valid_sol::CANFIELD: + tableau_pile_count = 4; + build_pol = build_policy::RED_BLACK; + reserve_size = 14; + stock_size = 34; + break; + case valid_sol::SIMPLE_CANFIELD: + tableau_pile_count = 3; + build_pol = build_policy::RED_BLACK; + max_rank = 4; + reserve_size = 3; + stock_size = 9; + break; default: assert(false); } diff --git a/src/main/sol_rules.h b/src/main/sol_rules.h index 26eae2e..aadda69 100644 --- a/src/main/sol_rules.h +++ b/src/main/sol_rules.h @@ -33,7 +33,8 @@ public: HEARTS, SPADES, ANY_SUIT, - SAME_SUIT + SAME_SUIT, + RED_BLACK }; static std::vector<std::string> valid_sol_strs; @@ -44,10 +45,13 @@ public: int tableau_pile_count; build_order build_ord; + build_policy build_pol; int max_rank; bool hole; bool foundations; int cells; + int reserve_size; + int stock_size; private: static valid_sol valid_sol_enum(const std::string&); |
