* Adds an item amount to the container. * @param id Item ID. * @param qty Item quantity. */
| 63 | * @param qty Item quantity. |
| 64 | */ |
| 65 | void ItemContainer::addItem(const std::string &id, int qty) |
| 66 | { |
| 67 | if (id.empty()) |
| 68 | { |
| 69 | return; |
| 70 | } |
| 71 | if (_qty.find(id) == _qty.end()) |
| 72 | { |
| 73 | _qty[id] = 0; |
| 74 | } |
| 75 | _qty[id] += qty; |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * Removes an item amount from the container. |