aboutsummaryrefslogtreecommitdiff
path: root/solvitaire/src/main/game/sol_rules.cpp
diff options
context:
space:
mode:
authorTom Harley2019-01-27 15:37:06 +0000
committerTom Harley2019-01-27 15:37:06 +0000
commita996283af7c21baaff0e114d58c34db820902c6f (patch)
tree2fe5b6f7a800d4a7b8a65ee345f8c98aa138e36b /solvitaire/src/main/game/sol_rules.cpp
parentSplit code into 3 files (diff)
downloadmetasol-a996283af7c21baaff0e114d58c34db820902c6f.tar.gz
metasol-a996283af7c21baaff0e114d58c34db820902c6f.zip

Reorganise repo

All solvitaire content has been shoved into a subdirectory to tidy up the root of the project. This also means solvitaire is treated similarly to other dependencies of the project, and allows other dependencies to be added easily.

There’s also a lot of other work done here, such as usign a thread pool library to manage the running of the voters.

Diffstat (limited to 'solvitaire/src/main/game/sol_rules.cpp')
-rw-r--r--solvitaire/src/main/game/sol_rules.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/solvitaire/src/main/game/sol_rules.cpp b/solvitaire/src/main/game/sol_rules.cpp
new file mode 100644
index 0000000..940b1a4
--- /dev/null
+++ b/solvitaire/src/main/game/sol_rules.cpp
@@ -0,0 +1,43 @@
+//
+// Created by thecharlesblake on 1/12/18.
+//
+
+#include "sol_rules.h"
+
+typedef sol_rules::build_policy pol;
+typedef sol_rules::spaces_policy s_pol;
+typedef sol_rules::stock_deal_type sdt;
+typedef sol_rules::direction dir;
+typedef sol_rules::face_up_policy fu;
+typedef sol_rules::built_group_type bgt;
+typedef sol_rules::foundations_init_type fit;
+
+// Note that the 'default' sol rules are set up by parsing the default json
+// rules description. This initialisation is really just for testing purposes.
+sol_rules::sol_rules() :
+ tableau_pile_count(0),
+ build_pol(pol::ANY_SUIT),
+ spaces_pol(s_pol::ANY),
+ move_built_group(bgt::NO),
+ built_group_pol(pol::ANY_SUIT),
+ two_decks(false),
+ max_rank(13),
+ hole(false),
+ foundations_present(false),
+ foundations_init_cards(fit::NONE),
+ foundations_base(1),
+ foundations_only_comp_piles(false),
+ diagonal_deal(false),
+ cells(0),
+ cells_pre_filled(0),
+ stock_size(0),
+ stock_deal_t(sdt::TABLEAU_PILES),
+ stock_deal_count(1),
+ reserve_size(0),
+ reserve_stacked(false),
+ face_up(fu::ALL),
+ sequence_count(0),
+ sequence_direction(dir::LEFT),
+ sequence_build_pol(pol::SAME_SUIT),
+ accordion_size(0) {
+}