#include <Inventory.h>
Public Member Functions | |
| Inventory (vector< Item > itms, string bgPngPath, int AmtSlots) | |
| Inventory () | |
| virtual | ~Inventory () |
| void | push (Item item) |
| void | pop (Item item, int Amt) |
| Item | swap (Item item, int index) |
| void | swap (int ind, int index) |
| vector< Item > | getItems () |
| Inventory::Inventory | ( | vector< Item > | itms, |
| string | bgPngPath, | ||
| int | AmtSlots ) |
ctor
| Inventory::Inventory | ( | ) |
!dtor
|
virtual |
dtor
| vector< Item > Inventory::getItems | ( | ) |
| void Inventory::pop | ( | Item | item, |
| int | Amt ) |
pops items 1 by 1
remove slot if 0 items in item stack there
| void Inventory::push | ( | Item | item | ) |
check how many of this item is in this stacked item, like 20 gold bars in a stack for eg
checks in our inventory at ith item, if we can add more gold bars to him, like if the max amt of gold bars that can be stacked is 30, then it checks if we can
add 1 of these items to inventory, add 1 gold bar
remove from stack of items, remove a bar
checks if theres even more like we asked for 200 gold or something
checks if theres space
adds the item as a new slot
empties out the stack of items
| void Inventory::swap | ( | int | ind, |
| int | index ) |
swap 2 items in the inventory
swap an item with one of the items in our inventory, like 30 chucken(at index like 4 or something) for 20 gold bars