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

Function getDepotAccessibleByWagons

plugins/pathable.cpp:411–433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409static unordered_set<df::coord> entry_tiles;
410
411static bool getDepotAccessibleByWagons(color_ostream &out, bool cache_scan_for_painting) {
412 if (cache_scan_for_painting) {
413 entry_tiles.clear();
414 wagon_path.clear();
415 }
416 unordered_set<df::coord> depot_coords;
417 if (!get_depot_coords(out, &depot_coords))
418 return false;
419 unordered_set<uint16_t> depot_pathability_groups;
420 if (!get_pathability_groups(out, &depot_pathability_groups, depot_coords))
421 return false;
422 if (!get_entry_tiles(&entry_tiles, depot_pathability_groups))
423 return false;
424 bool found_edge = false;
425 for (auto depot_pos : depot_coords) {
426 if (wagon_flood(out, cache_scan_for_painting ? &wagon_path : NULL, depot_pos, entry_tiles)) {
427 found_edge = true;
428 if (!cache_scan_for_painting)
429 break;
430 }
431 }
432 return found_edge;
433}
434
435static void paintScreenDepotAccess() {
436 PaintCtx ctx;

Callers

nothing calls this directly

Calls 5

get_depot_coordsFunction · 0.85
get_pathability_groupsFunction · 0.85
get_entry_tilesFunction · 0.85
wagon_floodFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected