| 391 | } |
| 392 | |
| 393 | bool 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 | |
| 422 | bool MaterialInfo::matches(const df::dfhack_material_category& cat) const |
| 423 | { |
nothing calls this directly
no test coverage detected