37 ItemMap::iterator i =
_items.find(tag);
42 _items.insert(std::pair<Common::UString, InventoryItem>(tag, item));
44 i->second.count += count;
53 ItemMap::iterator i =
_items.find(tag);
57 if (i->second.count > count)
58 i->second.count -= count;
A class holding an UTF-8 string.
bool empty() const
Is the string empty?
void addItem(const Common::UString &tag, int count=1)
bool hasItem(const Common::UString &tag) const
void removeItem(const Common::UString &tag, int count=1)
const std::map< Common::UString, InventoryItem > & getItems() const