diff options
Diffstat (limited to 'src/main/game_state.h')
| -rw-r--r-- | src/main/game_state.h | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/src/main/game_state.h b/src/main/game_state.h index ff92247..311c97f 100644 --- a/src/main/game_state.h +++ b/src/main/game_state.h @@ -12,26 +12,37 @@ #include <rapidjson/document.h> #include "card.h" +#include "sol_rules.h" +#include "pile.h" class game_state { public: - game_state(const rapidjson::Document&, std::string); - game_state(int seed, std::string); - std::vector<game_state> get_next_legal_states() const; + // 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(); + // 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: - void move_to_hole(int); - bool adjacent(const card& a, const card& b) const; - bool simple; - - std::vector<std::vector<card> > tableau_piles; - int max_rank; - card hole_card; - mutable bool solved; + static std::vector<card> shuffled_deck(int, int); + + void print_header(std::ostream&, const char*) const; + void print_foundations(std::ostream&) const; + void print_tableau_piles(std::ostream&) const; + void print_hole(std::ostream&) const; + + std::vector<pile> tableau_piles; + std::vector<pile> foundations; + sol_rules rules; + pile hole; }; |
