From bba8775ce7c63783303240470d4a4b8404c9498b Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Sat, 11 Nov 2017 11:36:27 +0000 Subject: Add src file directory structure --- src/main/game/sol_rules.h | 60 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/main/game/sol_rules.h (limited to 'src/main/game/sol_rules.h') diff --git a/src/main/game/sol_rules.h b/src/main/game/sol_rules.h new file mode 100644 index 0000000..44b83bb --- /dev/null +++ b/src/main/game/sol_rules.h @@ -0,0 +1,60 @@ +// +// Created by thecharlesblake on 10/28/17. +// + +#ifndef SOLVITAIRE_SOL_RULES_H +#define SOLVITAIRE_SOL_RULES_H + +#include +#include + +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 + }; + enum class build_order { + NO_BUILD, + DESCENDING, + ASCENDING, + BOTH, + SINGLE_CARD + }; + enum class build_policy { + CLUBS, + DIAMONDS, + HEARTS, + SPADES, + ANY_SUIT, + SAME_SUIT, + RED_BLACK + }; + + static std::vector valid_sol_strs; + static bool is_suit(build_policy); + static int suit_val(build_policy); + + sol_rules(std::string); + + unsigned int tableau_pile_count; + build_order build_ord; + build_policy build_pol; + unsigned int max_rank; + bool hole; + bool foundations; + unsigned int cells; + unsigned int reserve_size; + unsigned int stock_size; + +private: + static valid_sol valid_sol_enum(const std::string&); +}; + +#endif //SOLVITAIRE_SOL_RULES_H -- cgit v1.2.1 From b2173ab5118fb2c5700197ae8b295d1577aca3e9 Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Sun, 12 Nov 2017 10:17:10 +0000 Subject: Clean up sol_rules class --- src/main/game/sol_rules.h | 2 +- 1 file changed, 1 insertion(+), 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 44b83bb..b73097d 100644 --- a/src/main/game/sol_rules.h +++ b/src/main/game/sol_rules.h @@ -41,7 +41,7 @@ public: static bool is_suit(build_policy); static int suit_val(build_policy); - sol_rules(std::string); + explicit sol_rules(std::string); unsigned int tableau_pile_count; build_order build_ord; -- cgit v1.2.1