aboutsummaryrefslogtreecommitdiff
path: root/src/main/solver.h
blob: cff1e47ff1841951fc8199851c9f931d4ac65e20 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// Created by thecharlesblake on 10/24/17.
//

#ifndef SOLVITAIRE_SOLVER_H
#define SOLVITAIRE_SOLVER_H

#include <string>
#include <vector>

#include <boost/optional.hpp>

#include "game_state.h"
#include "sol_rules.h"

class solver {
public:
    solver(const game_state, const sol_rules&);
    bool run();

    friend std::ostream& operator<< (std::ostream&, const solver&);

private:
    struct node {
        node(const game_state);
        std::vector<game_state> history;
        game_state state;
    };

    const sol_rules rules;
    const node root;
    bool been_run;
    node solution;
    bool solution_found;
};


#endif //SOLVITAIRE_SOLVER_H