MCPcopy Create free account
hub / github.com/DFHack/dfhack / match_progress

Method match_progress

plugins/embark-assistant/overlay.cpp:313–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311//====================================================================
312
313void embark_assist::overlay::match_progress(uint16_t count, embark_assist::defs::match_results *match_results, bool done) {
314// color_ostream_proxy out(Core::getInstance().getConsole());
315 state->matching = !done;
316 state->match_count = count;
317
318 for (uint16_t i = 0; i < world->worldgen.worldgen_parms.dim_x; i++) {
319 for (uint16_t k = 0; k < world->worldgen.worldgen_parms.dim_y; k++) {
320 if (match_results->at(i).at(k).preliminary_match) {
321 state->world_match_grid[i][k] = yellow_x_pen;
322
323 } else if (match_results->at(i).at(k).contains_match) {
324 state->world_match_grid[i][k] = green_x_pen;
325 }
326 else {
327 state->world_match_grid[i][k] = empty_pen;
328 }
329 }
330 }
331
332 if (done && state->fileresult) {
333 state->fileresult_pass++;
334 if (state->fileresult_pass == 1) {
335 embark_assist::finder_ui::init(embark_assist::overlay::plugin_self, state->find_callback, state->max_inorganic, true);
336 }
337 else {
338 FILE* outfile = fopen(fileresult_file_name, "w");
339 fprintf(outfile, "%i\n", count);
340 fclose(outfile);
341 }
342 }
343}
344
345//====================================================================
346

Callers

nothing calls this directly

Calls 1

initFunction · 0.50

Tested by

no test coverage detected