29 mMergeDuplicates(mergeDuplicates)
67 item =
new ShopItem(inventoryIndex,
id, quantity, price);
92 if (shopItem->getId() == id)
Represents an item in a shop inventory.
void addDuplicate(int inventoryIndex, int quantity)
Add a duplicate.
std::string getElementAt(int i) override
Returns the name of item number i in the shop.
bool mMergeDuplicates
Look for duplicate entries on addition.
ShopItems(bool mergeDuplicates=false)
Constructor.
void addItem(int id, int amount, int price)
Adds an item to the list.
ShopItem * at(int i) const
Returns the item number i in the shop.
int getNumberOfElements() override
Returns the number of items in the shop.
void erase(int i)
Removes an element from the shop.
std::vector< ShopItem * > mShopItems
The list of items in the shop.
ShopItem * findItem(int id)
Searches the current items in the shop for the specified id and returns the item if found,...
void clear()
Clears the list of items in the shop.
void delete_all(Container &c)