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

Function get_tile_carve_minimal

plugins/blueprint.cpp:489–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

487}
488
489static const char * get_tile_carve_minimal(color_ostream &out, const df::coord &pos, const tile_context &) {
490 df::tiletype *tt = Maps::getTileType(pos);
491 if (!tt)
492 return NULL;
493
494 if (dig_job_cache.contains(pos)) {
495 df::job *job = dig_job_cache[pos];
496 switch (job->job_type) {
497 case df::job_type::CarveTrack:
498 switch (tileShape(*tt))
499 {
500 case tiletype_shape::FLOOR:
501 return get_track_str("track", *tt, job->specflag.carve_track_flags);
502 case tiletype_shape::RAMP:
503 return get_track_str("trackramp", *tt, job->specflag.carve_track_flags);
504 default:
505 break;
506 }
507 break;
508 case df::job_type::CarveFortification:
509 return "F";
510 default:
511 break;
512 }
513 }
514
515 auto td = Maps::getTileDesignation(pos);
516 auto occ = Maps::getTileOccupancy(pos);
517 switch (tileShape(*tt))
518 {
519 case tiletype_shape::WALL:
520 if (tileSpecial(*tt) == tiletype_special::SMOOTH && td && td->bits.smooth == 1)
521 return "F";
522 break;
523 case tiletype_shape::FLOOR:
524 if (tileSpecial(*tt) == tiletype_special::TRACK || has_track_designation(*occ))
525 return get_track_str("track", *tt, *occ);
526 break;
527 case tiletype_shape::RAMP:
528 if (tileSpecial(*tt) == tiletype_special::TRACK || has_track_designation(*occ))
529 return get_track_str("trackramp", *tt, *occ);
530 break;
531 case tiletype_shape::FORTIFICATION:
532 return "F";
533 default:
534 break;
535 }
536
537 return NULL;
538}
539
540static const char * get_tile_carve(color_ostream &out, const df::coord &pos, const tile_context &tc) {
541 const char * tile_carve_minimal = get_tile_carve_minimal(out, pos, tc);

Callers 1

get_tile_carveFunction · 0.85

Calls 8

getTileTypeFunction · 0.85
tileShapeFunction · 0.85
get_track_strFunction · 0.85
getTileDesignationFunction · 0.85
getTileOccupancyFunction · 0.85
tileSpecialFunction · 0.85
has_track_designationFunction · 0.85
containsMethod · 0.80

Tested by

no test coverage detected