Should only need dumpItemCollection and dumpBagContents internally so made them protected.

This commit is contained in:
Arthur Ice 2013-05-21 23:02:15 -07:00
parent d7546e09ee
commit 41dcd5bc29
2 changed files with 6 additions and 6 deletions

View File

@ -1053,8 +1053,7 @@ int16 Inventory::FindFreeSlot(bool for_bag, bool try_cursor, uint8 min_size, boo
return SLOT_INVALID; return SLOT_INVALID;
} }
void Inventory::dumpBagContents(ItemInst *inst) { void Inventory::dumpBagContents(ItemInst *inst, iter_inst *it) {
iter_inst it;
iter_contents itb; iter_contents itb;
if (!inst || !inst->IsType(ItemClassContainer)) if (!inst || !inst->IsType(ItemClassContainer))
@ -1067,7 +1066,7 @@ void Inventory::dumpBagContents(ItemInst *inst) {
continue; continue;
std::string subSlot; std::string subSlot;
StringFormat(subSlot," Slot %d: %s (%d)", Inventory::CalcSlotId(it->first, itb->first), StringFormat(subSlot," Slot %d: %s (%d)", Inventory::CalcSlotId((*it)->first, itb->first),
baginst->GetItem()->Name, (baginst->GetCharges()<=0) ? 1 : baginst->GetCharges()); baginst->GetItem()->Name, (baginst->GetCharges()<=0) ? 1 : baginst->GetCharges());
std::cout << subSlot << std::endl; std::cout << subSlot << std::endl;
} }
@ -1089,7 +1088,7 @@ void Inventory::dumpItemCollection(const map<int16, ItemInst*> &collection) {
StringFormat(slot, "Slot %d: %s (%d)",it->first, it->second->GetItem()->Name, (inst->GetCharges()<=0) ? 1 : inst->GetCharges()); StringFormat(slot, "Slot %d: %s (%d)",it->first, it->second->GetItem()->Name, (inst->GetCharges()<=0) ? 1 : inst->GetCharges());
std::cout << slot << std::endl; std::cout << slot << std::endl;
dumpBagContents(inst); dumpBagContents(inst, &it);
} }
} }

View File

@ -196,8 +196,6 @@ public:
// Test whether a given slot can support a container item // Test whether a given slot can support a container item
static bool SupportsContainers(int16 slot_id); static bool SupportsContainers(int16 slot_id);
void dumpItemCollection(const map<int16, ItemInst*> &collection);
void dumpBagContents(ItemInst *inst);
void dumpEntireInventory(); void dumpEntireInventory();
void dumpWornItems(); void dumpWornItems();
void dumpInventory(); void dumpInventory();
@ -214,6 +212,9 @@ protected:
// Protected Methods // Protected Methods
/////////////////////////////// ///////////////////////////////
void dumpItemCollection(const map<int16, ItemInst*> &collection);
void dumpBagContents(ItemInst *inst, iter_inst *it);
// Retrieves item within an inventory bucket // Retrieves item within an inventory bucket
ItemInst* _GetItem(const map<int16, ItemInst*>& bucket, int16 slot_id) const; ItemInst* _GetItem(const map<int16, ItemInst*>& bucket, int16 slot_id) const;