diff options
Diffstat (limited to 'cpp')
| -rw-r--r-- | cpp/nissy.cpp | 8 | ||||
| -rw-r--r-- | cpp/nissy.h | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/cpp/nissy.cpp b/cpp/nissy.cpp index e3193e1..6e1b700 100644 --- a/cpp/nissy.cpp +++ b/cpp/nissy.cpp | |||
| @@ -166,11 +166,13 @@ namespace nissy { | |||
| 166 | ifs.read(reinterpret_cast<char *>(data.data()), size); | 166 | ifs.read(reinterpret_cast<char *>(data.data()), size); |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | error solver::check_data() const | 169 | error solver::check_data() |
| 170 | { | 170 | { |
| 171 | auto err = nissy_checkdata(data.size(), | 171 | auto err_value = nissy_checkdata(data.size(), |
| 172 | reinterpret_cast<const char *>(data.data())); | 172 | reinterpret_cast<const char *>(data.data())); |
| 173 | return error{err}; | 173 | error err{err_value}; |
| 174 | data_checked = err.ok(); | ||
| 175 | return err; | ||
| 174 | } | 176 | } |
| 175 | 177 | ||
| 176 | void solver::unload_data() | 178 | void solver::unload_data() |
diff --git a/cpp/nissy.h b/cpp/nissy.h index 7ab466d..448704e 100644 --- a/cpp/nissy.h +++ b/cpp/nissy.h | |||
| @@ -84,10 +84,11 @@ namespace nissy { | |||
| 84 | size_t size; | 84 | size_t size; |
| 85 | std::string id; | 85 | std::string id; |
| 86 | std::vector<std::byte> data; | 86 | std::vector<std::byte> data; |
| 87 | bool data_checked; | ||
| 87 | 88 | ||
| 88 | error generate_data(); | 89 | error generate_data(); |
| 89 | void read_data(std::ifstream&); | 90 | void read_data(std::ifstream&); |
| 90 | error check_data() const; | 91 | error check_data(); |
| 91 | void unload_data(); | 92 | void unload_data(); |
| 92 | solve_result solve(const cube&, nissflag, unsigned minmoves, | 93 | solve_result solve(const cube&, nissflag, unsigned minmoves, |
| 93 | unsigned maxmoves, unsigned maxsols, int optimal, | 94 | unsigned maxmoves, unsigned maxsols, int optimal, |
