From 578f9c9f92d05b5907b91f07a4c732839d4dfca5 Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Mon, 6 Nov 2017 14:14:38 +0000 Subject: Add counting of states searched --- src/main/game_state.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/main/game_state.h') 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 get_next_legal_states() const; + std::vector 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 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 tableau_piles; std::vector foundations; - pile hole; sol_rules rules; + pile hole; }; -- cgit v1.2.1