From b8f4cae869eace06df73ac7c1c390cc42cfe499b Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Tue, 26 Dec 2017 17:29:24 +0000 Subject: Add basic tableau deal parsing --- src/main/main.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/main/main.cpp') diff --git a/src/main/main.cpp b/src/main/main.cpp index 54e9404..158ca07 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -3,9 +3,9 @@ #include #include "input-output/command_line_helper.h" -#include "input-output/deal_parser.h" #include "solver/solver.h" #include "input-output/log_helper.h" +#include "util/util.h" using namespace rapidjson; @@ -69,14 +69,15 @@ void solve_random_game(int seed, const sol_rules& rules) { } void solve_input_files(const vector input_files, const sol_rules& rules) { - deal_parser dp(rules); - - for (const string& input_json : input_files) { + for (const string& input_file : input_files) { try { + // Reads in the input file to a json doc + const Document in_doc = util::get_file_json(input_file); + // Attempts to create a game state object from the json - game_state gs = dp.parse(input_json); + game_state gs(rules, in_doc); - LOG_INFO ("Attempting to solve " << input_json << "..."); + LOG_INFO ("Attempting to solve " << input_file << "..."); solve_game(gs, rules); } catch (const runtime_error& error) { -- cgit v1.2.1