diff options
| author | Charlie Blake | 2017-12-28 10:10:46 +0000 |
|---|---|---|
| committer | GitHub | 2017-12-28 10:10:46 +0000 |
| commit | c6275f508b1ff142a1085ebda8ae9276ea7611c4 (patch) | |
| tree | 26b9855cf4a9ec808dae99b378fbbcfa7af4315f /src/main/game/game_state.h | |
| parent | Merge pull request #25 from thecharlesblake/docs (diff) | |
| parent | Added fc tests - currently intract. (diff) | |
| download | metasol-c6275f508b1ff142a1085ebda8ae9276ea7611c4.tar.gz metasol-c6275f508b1ff142a1085ebda8ae9276ea7611c4.zip | |
Merge pull request #26 from thecharlesblake/deal-description-and-test
Deal description and test
Diffstat (limited to 'src/main/game/game_state.h')
| -rw-r--r-- | src/main/game/game_state.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/game/game_state.h b/src/main/game/game_state.h index 873ca6f..4b96b72 100644 --- a/src/main/game/game_state.h +++ b/src/main/game/game_state.h @@ -15,12 +15,15 @@ #include "sol_rules.h" #include "pile.h" +class deal_parser; + class game_state { + friend class deal_parser; public: // Create a game state representation from a JSON doc - game_state(const rapidjson::Document&); + game_state(const sol_rules&, const rapidjson::Document&); // Do the same from a 'rules' object - game_state(int seed, const sol_rules&); + game_state(const sol_rules&, int seed); const std::vector<game_state> get_next_legal_states() const; bool is_solved() const; @@ -33,6 +36,8 @@ public: friend std::size_t hash_value(std::vector<pile> const&); private: + explicit game_state(const sol_rules&); + static std::vector<card> shuffled_deck(int, int); const game_state move(game_state&, pile*, pile*) const; @@ -44,6 +49,7 @@ private: void print_top_of_piles(std::ostream&, const std::vector<pile>&) const; void print_top_of_pile(std::ostream&, const pile&) const; + sol_rules rules; std::vector<pile> foundations; std::vector<pile> cells; std::vector<pile> tableau_piles; @@ -51,7 +57,6 @@ private: pile stock; pile waste; pile hole; - sol_rules rules; }; |
