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

Method Designations

plugins/dig.cpp:2327–2363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2325 std::unordered_map<df::coord, designation> designations;
2326public:
2327 Designations() {
2328 df::job_list_link *link = world->jobs.list.next;
2329 for (; link; link = link->next) {
2330 df::job *job = link->item;
2331
2332 if(!job || !Maps::isValidTilePos(job->pos))
2333 continue;
2334
2335 df::tile_designation td;
2336 df::tile_occupancy to;
2337 bool keep_if_taken = false;
2338
2339 switch (job->job_type) {
2340 case df::job_type::SmoothWall:
2341 case df::job_type::SmoothFloor:
2342 keep_if_taken = true;
2343 // fallthrough
2344 case df::job_type::CarveFortification:
2345 td.bits.smooth = 1;
2346 break;
2347 case df::job_type::DetailWall:
2348 case df::job_type::DetailFloor:
2349 td.bits.smooth = 2;
2350 break;
2351 case job_type::CarveTrack:
2352 to.bits.carve_track_north = job->specflag.carve_track_flags.bits.carve_track_north;
2353 to.bits.carve_track_south = job->specflag.carve_track_flags.bits.carve_track_south;
2354 to.bits.carve_track_west = job->specflag.carve_track_flags.bits.carve_track_west;
2355 to.bits.carve_track_east = job->specflag.carve_track_flags.bits.carve_track_east;
2356 break;
2357 default:
2358 continue;
2359 }
2360 if (keep_if_taken || !Job::getWorker(job))
2361 designations.emplace(job->pos, designation(job->pos, td, to));
2362 }
2363 }
2364
2365 // get from job; if no job, then fall back to querying map
2366 designation get(const df::coord &pos) const {

Callers

nothing calls this directly

Calls 2

isValidTilePosFunction · 0.85
designationClass · 0.70

Tested by

no test coverage detected