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

Method matches

library/modules/Materials.cpp:393–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393bool MaterialInfo::matches(const df::job_material_category& cat) const
394{
395 if (!material)
396 return false;
397
398#define TEST(bit,flag) if (cat.bits.bit && material->flags.is_set(flag)) return true;
399
400 using namespace df::enums::material_flags;
401 TEST(plant, STRUCTURAL_PLANT_MAT);
402 TEST(plant, SEED_MAT);
403 TEST(plant, THREAD_PLANT);
404 TEST(plant, ALCOHOL_PLANT);
405 TEST(plant, POWDER_MISC_PLANT);
406 TEST(plant, LIQUID_MISC_PLANT);
407 TEST(wood, WOOD);
408 TEST(cloth, THREAD_PLANT);
409 TEST(silk, SILK);
410 TEST(leather, LEATHER);
411 TEST(bone, BONE);
412 TEST(shell, SHELL);
413 TEST(wood2, WOOD);
414 TEST(soap, SOAP);
415 TEST(tooth, TOOTH);
416 TEST(horn, HORN);
417 TEST(pearl, PEARL);
418 TEST(yarn, YARN);
419 return false;
420}
421
422bool MaterialInfo::matches(const df::dfhack_material_category& cat) const
423{

Callers

nothing calls this directly

Calls 6

bits_matchFunction · 0.85
is_setMethod · 0.80
TESTFunction · 0.50
matchesFunction · 0.50
linear_indexFunction · 0.50
isValidFunction · 0.50

Tested by

no test coverage detected