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

Function get_tile_construct

plugins/blueprint.cpp:658–679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

656}
657
658static const char * get_tile_construct(color_ostream &out, const df::coord &pos, const tile_context &ctx) {
659 if (ctx.b && ctx.b->getType() == building_type::Construction)
660 return get_construction_str(ctx.b);
661
662 df::tiletype *tt = Maps::getTileType(pos);
663 if (!tt || tileMaterial(*tt) != df::tiletype_material::CONSTRUCTION)
664 return NULL;
665
666 switch (tileShape(*tt)) {
667 case tiletype_shape::WALL: return get_constructed_wall_str(pos);
668 case tiletype_shape::FLOOR: return get_constructed_floor_str(tt);
669 case tiletype_shape::RAMP: return get_constructed_ramp_str(tt);
670 case tiletype_shape::FORTIFICATION: return "CF";
671 case tiletype_shape::STAIR_UP: return "Cu";
672 case tiletype_shape::STAIR_DOWN: return "Cd";
673 case tiletype_shape::STAIR_UPDOWN: return "Cx";
674 default:
675 return "~";
676 }
677
678 return NULL;
679}
680
681static pair<uint32_t, uint32_t> get_building_size(const df::building *b) {
682 return pair<uint32_t, uint32_t>(b->x2 - b->x1 + 1, b->y2 - b->y1 + 1);

Callers

nothing calls this directly

Calls 8

get_construction_strFunction · 0.85
getTileTypeFunction · 0.85
tileMaterialFunction · 0.85
tileShapeFunction · 0.85
get_constructed_wall_strFunction · 0.85
get_constructed_ramp_strFunction · 0.85
getTypeMethod · 0.80

Tested by

no test coverage detected