int Inventory::getFreeSlot() const { Item **i = std::find_if(mItems, mItems + mSize, std::not1(SlotUsed())); return (i == mItems + static_cast<int>(mSize)) ? -1 : static_cast<int>(i - mItems); }
int Inventory::getLastUsedSlot() const { for (int i = mSize - 1; i >= 0; i--) if (SlotUsed()(mItems[i])) return i; return -1; }
int Inventory::getFreeSlot() const { Item *const *const i = std::find_if(mItems, mItems + mSize, std::not1(SlotUsed())); return (i == mItems + mSize) ? -1 : CAST_S32(i - mItems); }
int Inventory::getNumberOfSlotsUsed() const { return count_if(mItems, mItems + mSize, SlotUsed()); }