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

Function addPlannedBuilding

plugins/buildingplan/buildingplan.cpp:625–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

623}
624
625static bool addPlannedBuilding(color_ostream &out, df::building *bld) {
626 DEBUG(control,out).print("entering addPlannedBuilding\n");
627 if (!bld || planned_buildings.count(bld->id))
628 return false;
629
630 int16_t subtype = get_subtype(bld);
631
632 if (!isPlannableBuilding(out, bld->getType(), subtype, bld->getCustomType()))
633 return false;
634
635 BuildingTypeKey key(bld->getType(), subtype, bld->getCustomType());
636 PlannedBuilding pb(out, bld, get_heat_safety_filter(key), get_item_filters(out, key));
637
638 bool unsuspend_on_finalize = !is_suspendmanager_enabled(out);
639 return registerPlannedBuilding(out, pb, unsuspend_on_finalize);
640}
641
642static void doCycle(color_ostream &out) {
643 DEBUG(control,out).print("entering doCycle\n");

Callers

nothing calls this directly

Calls 9

get_subtypeFunction · 0.85
isPlannableBuildingFunction · 0.85
get_heat_safety_filterFunction · 0.85
get_item_filtersFunction · 0.85
registerPlannedBuildingFunction · 0.85
getTypeMethod · 0.80
printMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected