|
OpenEnroth 731eccc
|
#include <Inventory.h>
Friends | |
| class | Inventory |
| void | snapshot (const CharacterInventory &src, Character_MM7 *dst) |
| void | reconstruct (const Character_MM7 &src, CharacterInventory *dst, ContextTag< int > characterIndex) |
Additional Inherited Members | |
Private Member Functions inherited from Inventory | |
| Inventory (Sizei gridSize, int capacity) | |
| Inventory () | |
| int | size () const |
| int | capacity () const |
| Sizei | gridSize () const |
| Recti | gridRect () const |
| auto | entries (this auto &&self) |
| auto | entries (this auto &&self, ItemId itemId) |
| auto | equipment (this auto &&self) |
| auto | functionalEquipment (this auto &&self) |
| InventoryEntry | entry (Pointi position) |
| InventoryConstEntry | entry (Pointi position) const |
| InventoryEntry | entry (ItemSlot slot) |
| InventoryConstEntry | entry (ItemSlot slot) const |
| InventoryEntry | functionalEntry (ItemSlot slot) |
| InventoryConstEntry | functionalEntry (ItemSlot slot) const |
| InventoryEntry | entry (int index) |
| InventoryConstEntry | entry (int index) const |
| bool | canAdd (Pointi position, Sizei size) const |
| bool | canAdd (Pointi position, const Item &item) const |
| bool | canAdd (Sizei size) const |
| bool | canAdd (const Item &item) const |
| InventoryEntry | add (Pointi position, const Item &item) |
| InventoryEntry | add (const Item &item) |
| InventoryEntry | tryAdd (Pointi position, const Item &item) |
| InventoryEntry | tryAdd (const Item &item) |
| bool | canEquip (ItemSlot slot) const |
| InventoryEntry | equip (ItemSlot slot, const Item &item) |
| InventoryEntry | tryEquip (ItemSlot slot, const Item &item) |
| bool | canStash () const |
| InventoryEntry | stash (const Item &item) |
| InventoryEntry | tryStash (const Item &item) |
| Item | take (InventoryEntry entry) |
| std::optional< Pointi > | findSpace (Sizei size) const |
| std::optional< Pointi > | findSpace (const Item &item) const |
| InventoryEntry | find (ItemId itemId) |
| InventoryConstEntry | find (ItemId itemId) const |
| void | clear () |
Static Private Attributes inherited from Inventory | |
| static constexpr std::size_t | MAX_ITEMS = 140 |
Thin facade that exposes only the character‑appropriate subset of Inventory interface.
|
inline |
| InventoryEntry Inventory::add | ( | const Item & | item | ) |
| InventoryEntry Inventory::add | ( | Pointi | position, |
| const Item & | item | ||
| ) |
|
inline |
| bool Inventory::canAdd | ( | Sizei | size | ) | const |
| bool Inventory::canEquip | ( | ItemSlot | slot | ) | const |
|
inline |
| void Inventory::clear | ( | ) |
|
inline |
| self | *this. |
InventoryEntry or InventoryConstEntry objects for items in this inventory. Returned entries are never invalid.
|
inline |
| self | *this. |
| itemId | Item id to filter for. |
InventoryEntry or InventoryConstEntry objects for items in this inventory with the given itemId. Returned entries are never invalid. | InventoryEntry Inventory::entry | ( | int | index | ) |
| index | Entry index to look up an item. |
index, or an invalid entry if index is out of bounds or if there is no item at index.
|
inline |
| InventoryEntry Inventory::entry | ( | ItemSlot | slot | ) |
| slot | Equipment slot to look up an item. |
slot, or an invalid entry if that slot is empty.
|
inline |
| InventoryEntry Inventory::entry | ( | Pointi | position | ) |
| position | Grid position to look up an item. |
position is out of bounds or if the grid at position is empty.
|
inline |
| InventoryEntry Inventory::equip | ( | ItemSlot | slot, |
| const Item & | item | ||
| ) |
|
inline |
| self | *this. |
InventoryEntry or InventoryConstEntry objects for all equipped items in this inventory. Returned entries are never invalid. | InventoryEntry Inventory::find | ( | ItemId | itemId | ) |
|
inline |
|
inline |
| slot | Equipment slot to look up an item. |
slot, or an invalid entry if that slot is empty or if the item in the slot is non-functional (broken or out of charges).
|
inline |
|
inline |
| self | *this. |
InventoryEntry or InventoryConstEntry objects for all equipped items in this inventory that are functional (non-broken and not out of charges). Returned entries are never invalid.
|
inline |
inventory.gridRect().contains(pos).
|
inline |
| Item Inventory::take | ( | InventoryEntry | entry | ) |
| InventoryEntry Inventory::tryAdd | ( | const Item & | item | ) |
| InventoryEntry Inventory::tryAdd | ( | Pointi | position, |
| const Item & | item | ||
| ) |
| InventoryEntry Inventory::tryEquip | ( | ItemSlot | slot, |
| const Item & | item | ||
| ) |
|
friend |
|
friend |
|
friend |