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

Function matchesHeatSafety

plugins/buildingplan/buildingplan_cycle.cpp:123–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123bool matchesHeatSafety(int16_t mat_type, int32_t mat_index, HeatSafety heat) {
124 if (heat == HEAT_SAFETY_ANY)
125 return true;
126
127 MaterialInfo minfo(mat_type, mat_index);
128 df::job_item_flags2 ok;
129 df::job_item_flags2 mask;
130 minfo.getMatchBits(ok, mask);
131
132 if (heat >= HEAT_SAFETY_MAGMA)
133 return ok.bits.magma_safe;
134 if (heat == HEAT_SAFETY_FIRE)
135 return ok.bits.fire_safe || ok.bits.magma_safe;
136 return false;
137}
138
139bool matchesFilters(df::item * item, const df::job_item * jitem, HeatSafety heat, const ItemFilter &item_filter, const std::set<string> &specials) {
140 // check the properties that are not checked by Job::isSuitableItem()

Callers 2

getMaterialFilterFunction · 0.85
matchesFiltersFunction · 0.85

Calls 1

getMatchBitsMethod · 0.80

Tested by

no test coverage detected