aboutsummaryrefslogtreecommitdiff
path: root/src/main/game_state.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/game_state.h')
-rw-r--r--src/main/game_state.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/game_state.h b/src/main/game_state.h
index c5d4f96..311c97f 100644
--- a/src/main/game_state.h
+++ b/src/main/game_state.h
@@ -17,20 +17,23 @@
class game_state {
public:
+ // Create a game state representation from a JSON doc
game_state(const rapidjson::Document&);
+ // Do the same from a 'rules' object
game_state(int seed, const sol_rules&);
- std::vector<game_state> get_next_legal_states() const;
+ std::vector<game_state> get_next_legal_states();
+ // NOTE: will only be evaluated after get_next_legal_states() is called
bool is_solved() const;
+
std::ostream& print(std::ostream&) const;
+ friend bool operator==(const game_state&, const game_state&);
friend std::ostream& operator<< (std::ostream&, const game_state&);
private:
static std::vector<card> shuffled_deck(int, int);
- void move_to_hole(int);
- bool adjacent(const card& a, const card& b) const;
void print_header(std::ostream&, const char*) const;
void print_foundations(std::ostream&) const;
void print_tableau_piles(std::ostream&) const;
@@ -38,8 +41,8 @@ private:
std::vector<pile> tableau_piles;
std::vector<pile> foundations;
- pile hole;
sol_rules rules;
+ pile hole;
};