| 345 | } |
| 346 | |
| 347 | uint64_t ItemBag::stackTransfer(ItemConstPtr const& to, ItemConstPtr const& from) { |
| 348 | if (!from) |
| 349 | return 0; |
| 350 | else if (!to) |
| 351 | return from->count(); |
| 352 | else if (!to->stackableWith(from)) |
| 353 | return 0; |
| 354 | else |
| 355 | return std::min(to->maxStack() - to->count(), from->count()); |
| 356 | } |
| 357 | |
| 358 | size_t ItemBag::bestSlotAvailable(ItemConstPtr const& item, bool stacksOnly, std::function<bool(size_t)> test) const { |
| 359 | // First look for any slots that can stack, before empty slots. |
nothing calls this directly
no test coverage detected