diff options
| author | Charlie Blake | 2018-10-13 22:33:07 +0100 |
|---|---|---|
| committer | GitHub | 2018-10-13 22:33:07 +0100 |
| commit | b78faa72859e37f41503db1815e5496f327d20b8 (patch) | |
| tree | f5ec04f085779c03045fab051eb0bb519d4bfd96 /src/main/input-output/input/json-parsing/json_helper.h | |
| parent | Merge pull request #97 from thecharlesblake/comma-bug-ctd (diff) | |
| parent | Add json printing of initial deal (diff) | |
| download | metasol-b78faa72859e37f41503db1815e5496f327d20b8.tar.gz metasol-b78faa72859e37f41503db1815e5496f327d20b8.zip | |
Merge pull request #98 from thecharlesblake/deal-print
Deal print
Diffstat (limited to 'src/main/input-output/input/json-parsing/json_helper.h')
| -rw-r--r-- | src/main/input-output/input/json-parsing/json_helper.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/input-output/input/json-parsing/json_helper.h b/src/main/input-output/input/json-parsing/json_helper.h index b5e2d51..460911f 100644 --- a/src/main/input-output/input/json-parsing/json_helper.h +++ b/src/main/input-output/input/json-parsing/json_helper.h @@ -7,7 +7,11 @@ #include <string> +#include <boost/property_tree/ptree.hpp> +#include <boost/property_tree/json_parser.hpp> + #include "../../../../../lib/rapidjson/schema.h" +#include "../../../game/search-state/game_state.h" class json_helper { public: @@ -15,6 +19,12 @@ public: static void json_parse_warning(const std::string& msg); static void json_parse_err(const std::string& msg); static const std::string schema_err_str(const rapidjson::SchemaValidator&); + static void print_game_state_as_json(const game_state&); +private: + static boost::property_tree::ptree piles_to_ptree(const game_state&, const std::list<pile::ref>&); + static boost::property_tree::ptree piles_to_ptree(const game_state&, const std::vector<pile::ref>&); + static boost::property_tree::ptree pile_to_ptree(const pile&); + static boost::property_tree::ptree card_to_ptree(const card&); }; |
