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

Method getContainedItems

library/modules/Items.cpp:563–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

561}
562
563void Items::getContainedItems(df::item *item, vector<df::item *> *items) {
564 CHECK_NULL_POINTER(item);
565 CHECK_NULL_POINTER(items);
566 items->clear();
567
568 for (auto gref : item->general_refs) {
569 if (gref->getType() != general_ref_type::CONTAINS_ITEM)
570 continue;
571 else if (auto child = gref->getItem())
572 items->push_back(child);
573 }
574}
575
576df::building *Items::getHolderBuilding(df::item *item) {
577 auto ref = getGeneralRef(item, general_ref_type::BUILDING_HOLDER);

Callers

nothing calls this directly

Calls 2

getTypeMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected