aboutsummaryrefslogtreecommitdiff
path: root/src/main/game/sol_rules.h
diff options
context:
space:
mode:
authorCharlie Blake2017-11-14 02:24:07 +0000
committerGitHub2017-11-14 02:24:07 +0000
commit995ef52047458e1d59c396df7148ae55b7b93a3c (patch)
treee2d76d46bb435d01760bb01db9e4123f33063a2d /src/main/game/sol_rules.h
parentMerge pull request #20 from thecharlesblake/initial-code-cleanup (diff)
parentAdd logic for reading preset sols and file json (diff)
downloadmetasol-995ef52047458e1d59c396df7148ae55b7b93a3c.tar.gz
metasol-995ef52047458e1d59c396df7148ae55b7b93a3c.zip

Merge pull request #21 from thecharlesblake/json-rules

Json rules

Diffstat (limited to 'src/main/game/sol_rules.h')
-rw-r--r--src/main/game/sol_rules.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main/game/sol_rules.h b/src/main/game/sol_rules.h
index b73097d..17dd74a 100644
--- a/src/main/game/sol_rules.h
+++ b/src/main/game/sol_rules.h
@@ -8,6 +8,9 @@
#include <vector>
#include <string>
+#include <boost/optional.hpp>
+#include <rapidjson/document.h>
+
class sol_rules {
public:
enum class valid_sol {
@@ -37,12 +40,12 @@ public:
RED_BLACK
};
- static std::vector<std::string> valid_sol_strs;
+ 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);
- explicit sol_rules(std::string);
-
unsigned int tableau_pile_count;
build_order build_ord;
build_policy build_pol;
@@ -54,6 +57,10 @@ public:
unsigned int 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&);
};