Simulator::cSpaceInventory class

Base classes

class cGameData

Derived classes

class cPlayerInventory

Public static variables

static const uint32_t TYPE
static const uint32_t NOUN_ID

Public functions

void func54h() virtual
void SetMaxCargoAmount(int amount) virtual
auto GetItemCount() -> size_t virtual
auto GetItem(size_t index) -> cSpaceInventoryItem* virtual
auto IndexOf(int type, const ResourceKey& id) -> int virtual
auto GetTool(const ResourceKey& id) -> cSpaceInventoryItem* virtual
auto func6Ch(int type, size_t) -> int virtual
auto HasItem(int itemType, uint32_t id) -> bool pure virtual
auto HasTool(const ResourceKey& id) -> bool pure virtual
auto RemoveItem(cSpaceInventoryItem* pItem) -> bool virtual
auto func7Ch(size_t index, intrusive_ptr<cSpaceInventoryItem>& dst, int count) -> bool virtual
void AddItem(cSpaceInventoryItem* pItem, int = 0, bool = true) virtual
Adds the given item to the inventory.
auto GetItemByCargSlot(cSpaceInventoryItem* pCargoSlot) -> cSpaceInventoryItem* virtual
auto func88h() -> size_t virtual
auto func8Ch() -> size_t virtual
auto func90h(cSpaceInventoryItem*&) -> bool virtual
void GenerateItems(size_t count) virtual
auto func98h(cSpaceInventoryItem* pCargoSlot) -> bool virtual

Public variables

vector<intrusive_ptr<cSpaceInventoryItem>> mInventoryItems
int mMaxItemCountPerItem

Function documentation

void Simulator::cSpaceInventory::AddItem(cSpaceInventoryItem* pItem, int = 0, bool = true) virtual

Adds the given item to the inventory.

If it already exists, it returns false. If it does not exist but there is another item with the same ID (and the item is not unique), it will increase the amount (or ammo) of items with that ID.