背包模块(eve.Inventory)。 更多...
#include <Inventory.h>
Public 成员函数 | |
| Module_REG (Inventory) | |
| Inventory ()=default | |
| ~Inventory () override=default | |
| int | registerItemsFromJson (const std::string &json) |
| 从 JSON 注册物品定义;返回成功注册数量。 | |
| void | clearItemDefinitions () |
| 清空物品定义。 | |
| int | getItemDefinitionCount () |
| 已注册物品定义数量。 | |
| bool | hasItemDefinition (const std::string &itemId) |
| 物品定义查询(显示名/堆叠/重量/体积/类别/装备槽/标签/额外属性)。 | |
| std::string | getItemDisplayName (const std::string &itemId) |
| int | getItemMaxStack (const std::string &itemId) |
| float | getItemWeight (const std::string &itemId) |
| float | getItemVolume (const std::string &itemId) |
| std::string | getItemCategory (const std::string &itemId) |
| std::string | getItemEquipSlot (const std::string &itemId) |
| bool | itemHasTag (const std::string &itemId, const std::string &tag) |
| std::string | getItemExtra (const std::string &itemId, const std::string &key, const std::string &fallback={}) |
| Bag * | newBag (int slotCount) |
| 工厂:创建容器 / 装备栏。 | |
| EquipmentSet * | newEquipmentSet () |
| int | transferItem (Bag *from, Bag *to, const std::string &itemId, int quantity) |
| 跨容器转移(按物品 id / 按槽位);返回实际转移数量。 | |
| int | transferSlot (Bag *from, int fromSlot, Bag *to, int quantity) |
| bool | hasAcceptRule (const std::string &name) |
| 扩展策略是否存在(接受规则 / 容量策略 / 堆叠规则)。 | |
| bool | hasCapacityPolicy (const std::string &name) |
| bool | hasStackRule (const std::string &name) |
| void | clearChangeEvents () |
| 变更事件队列(添加/移除/移动/装备)。 | |
| int | getChangeEventCount () const |
| std::string | getChangeEventAction (int index) const |
| std::string | getChangeEventBagId (int index) const |
| std::string | getChangeEventOtherBagId (int index) const |
| std::string | getChangeEventItemId (int index) const |
| int | getChangeEventQuantity (int index) const |
| int | getChangeEventSlot (int index) const |
| int | getChangeEventOtherSlot (int index) const |
| std::string | getChangeEventEquipSlot (int index) const |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| virtual std::string | getName () const =0 |
详细描述
背包模块(eve.Inventory)。
在文件 Inventory.h 第 17 行定义.
构造及析构函数说明
◆ Inventory()
|
default |
◆ ~Inventory()
|
overridedefault |
成员函数说明
◆ clearChangeEvents()
| void eve::inventory::Inventory::clearChangeEvents | ( | ) |
变更事件队列(添加/移除/移动/装备)。
在文件 Inventory.cpp 第 95 行定义.
◆ clearItemDefinitions()
| void eve::inventory::Inventory::clearItemDefinitions | ( | ) |
◆ getChangeEventAction()
| std::string eve::inventory::Inventory::getChangeEventAction | ( | int | index | ) | const |
在文件 Inventory.cpp 第 101 行定义.
◆ getChangeEventBagId()
| std::string eve::inventory::Inventory::getChangeEventBagId | ( | int | index | ) | const |
在文件 Inventory.cpp 第 107 行定义.
◆ getChangeEventCount()
| int eve::inventory::Inventory::getChangeEventCount | ( | ) | const |
在文件 Inventory.cpp 第 97 行定义.
◆ getChangeEventEquipSlot()
| std::string eve::inventory::Inventory::getChangeEventEquipSlot | ( | int | index | ) | const |
在文件 Inventory.cpp 第 143 行定义.
◆ getChangeEventItemId()
| std::string eve::inventory::Inventory::getChangeEventItemId | ( | int | index | ) | const |
在文件 Inventory.cpp 第 119 行定义.
◆ getChangeEventOtherBagId()
| std::string eve::inventory::Inventory::getChangeEventOtherBagId | ( | int | index | ) | const |
在文件 Inventory.cpp 第 113 行定义.
◆ getChangeEventOtherSlot()
| int eve::inventory::Inventory::getChangeEventOtherSlot | ( | int | index | ) | const |
在文件 Inventory.cpp 第 137 行定义.
◆ getChangeEventQuantity()
| int eve::inventory::Inventory::getChangeEventQuantity | ( | int | index | ) | const |
在文件 Inventory.cpp 第 125 行定义.
◆ getChangeEventSlot()
| int eve::inventory::Inventory::getChangeEventSlot | ( | int | index | ) | const |
在文件 Inventory.cpp 第 131 行定义.
◆ getItemCategory()
| std::string eve::inventory::Inventory::getItemCategory | ( | const std::string & | itemId | ) |
在文件 Inventory.cpp 第 44 行定义.
◆ getItemDefinitionCount()
| int eve::inventory::Inventory::getItemDefinitionCount | ( | ) |
◆ getItemDisplayName()
| std::string eve::inventory::Inventory::getItemDisplayName | ( | const std::string & | itemId | ) |
在文件 Inventory.cpp 第 24 行定义.
◆ getItemEquipSlot()
| std::string eve::inventory::Inventory::getItemEquipSlot | ( | const std::string & | itemId | ) |
在文件 Inventory.cpp 第 49 行定义.
◆ getItemExtra()
| std::string eve::inventory::Inventory::getItemExtra | ( | const std::string & | itemId, |
| const std::string & | key, | ||
| const std::string & | fallback = {} |
||
| ) |
在文件 Inventory.cpp 第 59 行定义.
◆ getItemMaxStack()
| int eve::inventory::Inventory::getItemMaxStack | ( | const std::string & | itemId | ) |
在文件 Inventory.cpp 第 29 行定义.
◆ getItemVolume()
| float eve::inventory::Inventory::getItemVolume | ( | const std::string & | itemId | ) |
在文件 Inventory.cpp 第 39 行定义.
◆ getItemWeight()
| float eve::inventory::Inventory::getItemWeight | ( | const std::string & | itemId | ) |
在文件 Inventory.cpp 第 34 行定义.
◆ hasAcceptRule()
| bool eve::inventory::Inventory::hasAcceptRule | ( | const std::string & | name | ) |
扩展策略是否存在(接受规则 / 容量策略 / 堆叠规则)。
在文件 Inventory.cpp 第 83 行定义.
引用了 eve::inventory::InventorySystem::hasAcceptRule() , 以及 name.
◆ hasCapacityPolicy()
| bool eve::inventory::Inventory::hasCapacityPolicy | ( | const std::string & | name | ) |
在文件 Inventory.cpp 第 87 行定义.
引用了 eve::inventory::InventorySystem::hasCapacityPolicy() , 以及 name.
◆ hasItemDefinition()
| bool eve::inventory::Inventory::hasItemDefinition | ( | const std::string & | itemId | ) |
物品定义查询(显示名/堆叠/重量/体积/类别/装备槽/标签/额外属性)。
在文件 Inventory.cpp 第 20 行定义.
◆ hasStackRule()
| bool eve::inventory::Inventory::hasStackRule | ( | const std::string & | name | ) |
在文件 Inventory.cpp 第 91 行定义.
引用了 eve::inventory::InventorySystem::hasStackRule() , 以及 name.
◆ itemHasTag()
| bool eve::inventory::Inventory::itemHasTag | ( | const std::string & | itemId, |
| const std::string & | tag | ||
| ) |
在文件 Inventory.cpp 第 54 行定义.
◆ Module_REG()
| eve::inventory::Inventory::Module_REG | ( | Inventory | ) |
◆ newBag()
| Bag * eve::inventory::Inventory::newBag | ( | int | slotCount | ) |
◆ newEquipmentSet()
| EquipmentSet * eve::inventory::Inventory::newEquipmentSet | ( | ) |
在文件 Inventory.cpp 第 70 行定义.
◆ registerItemsFromJson()
| int eve::inventory::Inventory::registerItemsFromJson | ( | const std::string & | json | ) |
从 JSON 注册物品定义;返回成功注册数量。
在文件 Inventory.cpp 第 11 行定义.
引用了 eve::inventory::InventorySystem::ensureBuiltins() , 以及 eve::inventory::ItemRegistry::loadFromJson().
◆ transferItem()
| int eve::inventory::Inventory::transferItem | ( | Bag * | from, |
| Bag * | to, | ||
| const std::string & | itemId, | ||
| int | quantity | ||
| ) |
跨容器转移(按物品 id / 按槽位);返回实际转移数量。
在文件 Inventory.cpp 第 75 行定义.
◆ transferSlot()
在文件 Inventory.cpp 第 79 行定义.
该类的文档由以下文件生成:
- src/modules/inventory/Inventory.h
- src/modules/inventory/Inventory.cpp
Public 成员函数 继承自