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

Function getCurLevelDesignatedCount

plugins/dig.cpp:2033–2053  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2031}
2032
2033static int getCurLevelDesignatedCount(color_ostream &out) {
2034 std::unordered_map<df::coord, df::job *> dig_jobs;
2035 fill_dig_jobs(dig_jobs);
2036
2037 int count = 0;
2038 const int z = *window_z;
2039 for (auto & block : world->map.map_blocks) {
2040 if (block->map_pos.z != z)
2041 continue;
2042
2043 const auto & block_pos = block->map_pos;
2044 for (uint32_t x = 0; x < 16; x++) for (uint32_t y = 0; y < 16; y++) {
2045 if (!block->designation[x % 16][y % 16].bits.hidden)
2046 continue;
2047 df::coord pos = block_pos + df::coord(x, y, 0);
2048 if (block->designation[x][y].bits.dig || dig_jobs.contains(pos))
2049 ++count;
2050 }
2051 }
2052 return count;
2053}
2054
2055static void toggleCurLevelWarmDig(color_ostream &out) {
2056 toggle_cur_level(out, warm_config);

Callers

nothing calls this directly

Calls 2

fill_dig_jobsFunction · 0.85
containsMethod · 0.80

Tested by

no test coverage detected