diff options
| author | thecharlesblake | 2017-10-26 14:51:13 +0100 |
|---|---|---|
| committer | thecharlesblake | 2017-10-27 10:28:29 +0100 |
| commit | 3eff79ed14f1fda1f148a9a4c5c3a1ae4edbee37 (patch) | |
| tree | e0d25f622a2e35e72172cc0409e4c0937ed2c3f5 /src/main/game_state.h | |
| parent | Draft of OO game logic (diff) | |
| download | metasol-3eff79ed14f1fda1f148a9a4c5c3a1ae4edbee37.tar.gz metasol-3eff79ed14f1fda1f148a9a4c5c3a1ae4edbee37.zip | |
BH Solver with path outputted, based on user input
Diffstat (limited to 'src/main/game_state.h')
| -rw-r--r-- | src/main/game_state.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/main/game_state.h b/src/main/game_state.h index 693b127..3d0d38f 100644 --- a/src/main/game_state.h +++ b/src/main/game_state.h @@ -1,5 +1,5 @@ // -// Created by thecharlesblake on 10/23/17. +// Created by thecharlesblake on 10/24/17. // #ifndef SOLVITAIRE_GAME_STATE_H @@ -10,19 +10,26 @@ #include <rapidjson/document.h> -#include "card.h +#include "card.h" class game_state { public: game_state(const rapidjson::Document&); - virtual std::vector<game_state> get_next_legal_states() const = 0; - virtual bool is_solved() const = 0; - virtual std::ostream& print(std::ostream&) const; + std::vector<game_state> get_next_legal_states() const; + bool is_solved() const; + std::ostream& print(std::ostream&) const; friend std::ostream& operator<< (std::ostream&, const game_state&); -protected: - std::vector<std::vector<card>> tableau_piles; +private: + void move_to_hole(int); + bool adjacent(const card& a, const card& b) const; + + std::vector<std::vector<card> > tableau_piles; + int max_rank; + card hole_card; + mutable bool solved; }; + #endif //SOLVITAIRE_GAME_STATE_H |
