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

Method matches

library/modules/Items.cpp:222–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222bool ItemTypeInfo::matches(df::job_item_vector_id vec_id) {
223 auto other_id = ENUM_ATTR(job_item_vector_id, other, vec_id);
224
225 auto explicit_item = ENUM_ATTR(items_other_id, item, other_id);
226 if (explicit_item != item_type::NONE && type != explicit_item)
227 return false;
228
229 auto generic_item = ENUM_ATTR(items_other_id, generic_item, other_id);
230 if (generic_item.size > 0) {
231 for (size_t i = 0; i < generic_item.size; i++)
232 if (generic_item.items[i] == type)
233 return true;
234 return false;
235 }
236 return true;
237}
238
239bool ItemTypeInfo::matches(const df::job_item &jitem, MaterialInfo *mat,
240 bool skip_vector, df::item_type itype)

Callers 4

dfhack_matinfo_matchesFunction · 0.45
isSuitableItemMethod · 0.45
isSuitableMaterialMethod · 0.45

Calls 7

bits_matchFunction · 0.85
getMatchBitsMethod · 0.80
is_setMethod · 0.80
isValidFunction · 0.50
matchesFunction · 0.50
linear_indexFunction · 0.50
printerrFunction · 0.50

Tested by

no test coverage detected