MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / takeItems

Method takeItems

source/game/StarItemBag.cpp:135–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135ItemPtr ItemBag::takeItems(size_t pos, uint64_t count) {
136 if (auto& storedItem = at(pos)) {
137 auto taken = storedItem->take(count);
138 if (storedItem->empty())
139 storedItem = {};
140
141 return taken;
142 } else {
143 return {};
144 }
145}
146
147ItemPtr ItemBag::swapItems(size_t pos, ItemPtr items, bool tryCombine) {
148 auto& storedItem = at(pos);

Callers 3

takeItemMethod · 0.45
takeFromContainerSlotMethod · 0.45
swapSlotMethod · 0.45

Calls 2

takeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected