aboutsummaryrefslogtreecommitdiff
path: root/src/main/game/game_state.h
diff options
context:
space:
mode:
authorthecharlesblake2018-02-14 16:42:38 +0000
committerthecharlesblake2018-02-14 16:59:07 +0000
commit86ce38efc5ad3bf4fe06ef4c515591545e6fe925 (patch)
tree538d77e74fef34fb460326875e9b861401f4b3e8 /src/main/game/game_state.h
parentResolve name ambiguity in card class (diff)
downloadmetasol-86ce38efc5ad3bf4fe06ef4c515591545e6fe925.tar.gz
metasol-86ce38efc5ad3bf4fe06ef4c515591545e6fe925.zip

Update game rep to deal with foundation dominance

Diffstat (limited to 'src/main/game/game_state.h')
-rw-r--r--src/main/game/game_state.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/game/game_state.h b/src/main/game/game_state.h
index 9b0d7b5..2b68e8c 100644
--- a/src/main/game/game_state.h
+++ b/src/main/game/game_state.h
@@ -11,6 +11,7 @@
#include <rapidjson/document.h>
#include <boost/functional/hash.hpp>
+#include <boost/optional/optional.hpp>
#include "card.h"
#include "pile.h"
@@ -28,6 +29,9 @@ public:
typedef uint8_t pile_ref;
struct move {
move(pile_ref, pile_ref, pile::size_type = 1);
+ bool is_dominance() const;
+
+ const static pile::size_type dominance_flag;
pile_ref from; pile_ref to; pile::size_type count;
};
@@ -49,6 +53,8 @@ public:
// Inspects state
bool is_solved() const;
+ const std::vector<pile>& get_data() const;
+ boost::optional<move> get_dominance_move() const;
friend std::ostream& operator<< (std::ostream&, const game_state&);
@@ -74,6 +80,8 @@ private:
void add_empty_built_group_moves(std::vector<move>&, pile_ref, pile_ref,
card) const;
+ void assess_auto_foundation_moves(pile_ref);
+
// References to piles
const sol_rules rules;
std::list<pile_ref> tableau_piles;
@@ -90,6 +98,8 @@ private:
std::vector<pile_ref> original_cells;
std::vector<pile_ref> original_reserve;
+ std::vector<bool> auto_foundation_moves;
+
// The core piles
std::vector<pile> piles;
};