diff options
| author | Tom Harley | 2019-01-29 19:12:22 +0000 |
|---|---|---|
| committer | Tom Harley | 2019-01-29 19:12:22 +0000 |
| commit | 7b4f42242d277adeaec7a40eaac7d178141d4621 (patch) | |
| tree | eacece268545df914d730ad80d6a1b69f1448296 /solvitaire/src/main/api.cpp | |
| parent | Add support for reading gamestates from json files (diff) | |
| download | metasol-7b4f42242d277adeaec7a40eaac7d178141d4621.tar.gz metasol-7b4f42242d277adeaec7a40eaac7d178141d4621.zip | |
Reorganise submodules (and submodulise solvitaire)
The submodules should now point to repos I’ve made in order to produce static libraries from them. Also, solvitaire now points to a similar personal repo.
Diffstat (limited to 'solvitaire/src/main/api.cpp')
| m--------- | solvitaire | 0 | ||||
| -rw-r--r-- | solvitaire/src/main/api.cpp | 24 |
2 files changed, 0 insertions, 24 deletions
diff --git a/solvitaire b/solvitaire new file mode 160000 +Subproject b835e10bfb21a73b4f89e09ddeb400f41538483 diff --git a/solvitaire/src/main/api.cpp b/solvitaire/src/main/api.cpp deleted file mode 100644 index 1cf187c..0000000 --- a/solvitaire/src/main/api.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include <cstdint> -#include <vector> -#include <string> - -#include "game/search-state/game_state.h" -#include "solver/solver.h" - -#include "api.h" - -solver::result::type get_moves(std::vector<move>& moves, game_state& gs, - uint64_t cache_capacity, uint64_t timeout) { - moves.clear(); - - solver sol(gs, cache_capacity); - solver::result res = sol.run(std::chrono::milliseconds(timeout)); - if (res.sol_type == solver::result::type::SOLVED) { - std::vector<solver::node> nodes = sol.get_frontier(); - for (auto &it : nodes) { - moves.push_back(it.mv); - } - } - - return res.sol_type; -} |
