#include <Item.h>
静态 Public 成员函数 | |
| static void | registerItem (const ItemDefinition &def) |
| static const ItemDefinition * | find (const std::string &id) |
| static bool | remove (const std::string &id) |
| static void | clear () |
| static int | count () |
| static int | loadFromJson (const std::string &json, std::string *error=nullptr) |
| 从 JSON 数组或单对象批量注册,返回成功数量。 元素形如: { "id": "potion.hp", "displayName": "治疗药水", "maxStack": 20, "weight": 0.2, "volume": 0.1, "category": "consumable", "tags": ["potion"], "equipSlot": "", "extra": {"icon": "ui/potion.png"} } | |
详细描述
成员函数说明
◆ clear()
|
static |
◆ count()
|
static |
◆ find()
|
static |
被这些函数引用 eve::inventory::InventorySystem::addItem(), eve::inventory::InventorySystem::canAdd(), eve::inventory::EquipmentSet::canEquipFromBag(), eve::inventory::InventorySystem::findItemByTag(), eve::inventory::Inventory::getItemCategory(), eve::inventory::Inventory::getItemDisplayName(), eve::inventory::Inventory::getItemEquipSlot(), eve::inventory::Inventory::getItemExtra(), eve::inventory::Inventory::getItemMaxStack(), eve::inventory::Inventory::getItemVolume(), eve::inventory::Inventory::getItemWeight(), eve::inventory::Inventory::hasItemDefinition(), eve::inventory::Inventory::itemHasTag(), eve::inventory::InventorySystem::moveSlot(), eve::inventory::InventorySystem::transferSlot(), eve::inventory::InventorySystem::usedVolume() , 以及 eve::inventory::InventorySystem::usedWeight().
◆ loadFromJson()
|
static |
从 JSON 数组或单对象批量注册,返回成功数量。 元素形如: { "id": "potion.hp", "displayName": "治疗药水", "maxStack": 20, "weight": 0.2, "volume": 0.1, "category": "consumable", "tags": ["potion"], "equipSlot": "", "extra": {"icon": "ui/potion.png"} }
引用了 eve::json::Value::at(), error, eve::inventory::ItemDefinition::id, eve::json::Value::isArray(), eve::json::Value::isObject(), n, eve::json::Document::parse(), registerItem(), eve::json::Document::root(), eve::json::Value::size() , 以及 eve::json::Document::valid().
◆ registerItem()
|
static |
◆ remove()
该类的文档由以下文件生成: