MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / addItem

Method addItem

src/Savegame/ItemContainer.cpp:65–76  ·  view source on GitHub ↗

* Adds an item amount to the container. * @param id Item ID. * @param qty Item quantity. */

Source from the content-addressed store, hash-verified

63 * @param qty Item quantity.
64 */
65void 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.

Callers

nothing calls this directly

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected