aboutsummaryrefslogtreecommitdiff
path: root/src/main/sol_rules.h
diff options
context:
space:
mode:
authorCharlie Blake2017-11-06 14:31:04 +0000
committerGitHub2017-11-06 14:31:04 +0000
commitd67ed718a0955c577cafc5716dc5ec5dc0129e9d (patch)
treef9c8a6578fcd73548a88ea8f06c2f22c8310cce8 /src/main/sol_rules.h
parentMerge pull request #14 from thecharlesblake/simple-black-hole (diff)
parentAdd counting of states searched (diff)
downloadmetasol-d67ed718a0955c577cafc5716dc5ec5dc0129e9d.tar.gz
metasol-d67ed718a0955c577cafc5716dc5ec5dc0129e9d.zip

Merge pull request #15 from thecharlesblake/spanish-patience

Spanish patience

Diffstat (limited to 'src/main/sol_rules.h')
-rw-r--r--src/main/sol_rules.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/main/sol_rules.h b/src/main/sol_rules.h
new file mode 100644
index 0000000..671e8b7
--- /dev/null
+++ b/src/main/sol_rules.h
@@ -0,0 +1,50 @@
+//
+// Created by thecharlesblake on 10/28/17.
+//
+
+#ifndef SOLVITAIRE_SOL_RULES_H
+#define SOLVITAIRE_SOL_RULES_H
+
+#include <vector>
+#include <string>
+
+class sol_rules {
+public:
+ enum class valid_sol {
+ BLACK_HOLE,
+ SIMPLE_BLACK_HOLE,
+ SPANISH_PATIENCE,
+ SIMPLE_SPANISH_PATIENCE
+ };
+ enum class build_order {
+ NO_BUILD,
+ DESCENDING,
+ ASCENDING,
+ BOTH
+ };
+ enum class build_policy {
+ CLUBS,
+ DIAMONDS,
+ HEARTS,
+ SPADES,
+ ANY_SUIT,
+ SAME_SUIT
+ };
+
+ static std::vector<std::string> valid_sol_strs;
+ static bool is_suit(build_policy);
+ static int suit_val(build_policy);
+
+ sol_rules(std::string);
+
+ int tableau_pile_count;
+ build_order build_ord;
+ int max_rank;
+ bool hole;
+ bool foundations;
+
+private:
+ static valid_sol valid_sol_enum(const std::string&);
+};
+
+#endif //SOLVITAIRE_SOL_RULES_H