// // Created by thecharlesblake on 10/24/17. // #ifndef SOLVITAIRE_SOLVER_H #define SOLVITAIRE_SOLVER_H #include #include #include #include "../game/global_cache.h" #include "../game/sol_rules.h" class solver { public: global_cache cache; struct node { node(node*, game_state::move); node* parent; const game_state::move move; std::list children; }; explicit solver(const game_state&); bool run(); void print_solution() const; int get_states_searched() const; const node& get_search_tree() const; private: bool revert_to_last_node_with_children(); void add_children(std::vector&); void add_child(game_state::move); const game_state init_state; game_state state; int states_searched; node root; node* current_node; }; #endif //SOLVITAIRE_SOLVER_H