#pragma once #include namespace mods::itemstack { // Items of one type in the stack held by item `id` (1 for an item without one). unsigned StackCount(uint32_t id); // Sets the stack size of item `id` (1 or less: no stack). Used when loading. void SetStackCount(uint32_t id, unsigned count); // cInventoryEntry::ReplaceItemId: the stack follows its item to the new id. void OnItemIdReplaced(uint32_t oldId, uint32_t newId); // An item of `type` in `inventory` whose stack has room for one more, or 0. uint32_t StackWithRoom(const uint8_t* inventory, uint32_t type); // Forgets all stacks (a save game is about to be loaded). void ResetStacks(); } // namespace mods::itemstack