载入中...
搜索中...
未找到
eve::inventory::Inventory类 参考

背包模块(eve.Inventory)。 更多...

#include <Inventory.h>

类 eve::inventory::Inventory 继承关系图:
eve::Module

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={})
 
BagnewBag (int slotCount)
 工厂:创建容器 / 装备栏。
 
EquipmentSetnewEquipmentSet ()
 
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.h17 行定义.

构造及析构函数说明

◆ Inventory()

eve::inventory::Inventory::Inventory ( )
default

◆ ~Inventory()

eve::inventory::Inventory::~Inventory ( )
overridedefault

成员函数说明

◆ clearChangeEvents()

void eve::inventory::Inventory::clearChangeEvents ( )

变更事件队列(添加/移除/移动/装备)。

在文件 Inventory.cpp95 行定义.

引用了 eve::inventory::InventorySystem::clearEvents().

◆ clearItemDefinitions()

void eve::inventory::Inventory::clearItemDefinitions ( )

清空物品定义。

在文件 Inventory.cpp16 行定义.

引用了 eve::inventory::ItemRegistry::clear().

◆ getChangeEventAction()

std::string eve::inventory::Inventory::getChangeEventAction ( int  index) const

在文件 Inventory.cpp101 行定义.

引用了 eve::inventory::InventorySystem::events().

◆ getChangeEventBagId()

std::string eve::inventory::Inventory::getChangeEventBagId ( int  index) const

在文件 Inventory.cpp107 行定义.

引用了 eve::inventory::InventorySystem::events().

◆ getChangeEventCount()

int eve::inventory::Inventory::getChangeEventCount ( ) const

在文件 Inventory.cpp97 行定义.

引用了 eve::inventory::InventorySystem::events().

◆ getChangeEventEquipSlot()

std::string eve::inventory::Inventory::getChangeEventEquipSlot ( int  index) const

在文件 Inventory.cpp143 行定义.

引用了 eve::inventory::InventorySystem::events().

◆ getChangeEventItemId()

std::string eve::inventory::Inventory::getChangeEventItemId ( int  index) const

在文件 Inventory.cpp119 行定义.

引用了 eve::inventory::InventorySystem::events().

◆ getChangeEventOtherBagId()

std::string eve::inventory::Inventory::getChangeEventOtherBagId ( int  index) const

在文件 Inventory.cpp113 行定义.

引用了 eve::inventory::InventorySystem::events().

◆ getChangeEventOtherSlot()

int eve::inventory::Inventory::getChangeEventOtherSlot ( int  index) const

在文件 Inventory.cpp137 行定义.

引用了 eve::inventory::InventorySystem::events().

◆ getChangeEventQuantity()

int eve::inventory::Inventory::getChangeEventQuantity ( int  index) const

在文件 Inventory.cpp125 行定义.

引用了 eve::inventory::InventorySystem::events().

◆ getChangeEventSlot()

int eve::inventory::Inventory::getChangeEventSlot ( int  index) const

在文件 Inventory.cpp131 行定义.

引用了 eve::inventory::InventorySystem::events().

◆ getItemCategory()

std::string eve::inventory::Inventory::getItemCategory ( const std::string &  itemId)

在文件 Inventory.cpp44 行定义.

引用了 eve::inventory::ItemRegistry::find().

◆ getItemDefinitionCount()

int eve::inventory::Inventory::getItemDefinitionCount ( )

已注册物品定义数量。

在文件 Inventory.cpp18 行定义.

引用了 eve::inventory::ItemRegistry::count().

◆ getItemDisplayName()

std::string eve::inventory::Inventory::getItemDisplayName ( const std::string &  itemId)

在文件 Inventory.cpp24 行定义.

引用了 eve::inventory::ItemRegistry::find().

◆ getItemEquipSlot()

std::string eve::inventory::Inventory::getItemEquipSlot ( const std::string &  itemId)

在文件 Inventory.cpp49 行定义.

引用了 eve::inventory::ItemRegistry::find().

◆ getItemExtra()

std::string eve::inventory::Inventory::getItemExtra ( const std::string &  itemId,
const std::string &  key,
const std::string &  fallback = {} 
)

在文件 Inventory.cpp59 行定义.

引用了 eve::inventory::ItemRegistry::find().

◆ getItemMaxStack()

int eve::inventory::Inventory::getItemMaxStack ( const std::string &  itemId)

在文件 Inventory.cpp29 行定义.

引用了 eve::inventory::ItemRegistry::find().

◆ getItemVolume()

float eve::inventory::Inventory::getItemVolume ( const std::string &  itemId)

在文件 Inventory.cpp39 行定义.

引用了 eve::inventory::ItemRegistry::find().

◆ getItemWeight()

float eve::inventory::Inventory::getItemWeight ( const std::string &  itemId)

在文件 Inventory.cpp34 行定义.

引用了 eve::inventory::ItemRegistry::find().

◆ hasAcceptRule()

bool eve::inventory::Inventory::hasAcceptRule ( const std::string &  name)

扩展策略是否存在(接受规则 / 容量策略 / 堆叠规则)。

在文件 Inventory.cpp83 行定义.

引用了 eve::inventory::InventorySystem::hasAcceptRule() , 以及 name.

◆ hasCapacityPolicy()

bool eve::inventory::Inventory::hasCapacityPolicy ( const std::string &  name)

在文件 Inventory.cpp87 行定义.

引用了 eve::inventory::InventorySystem::hasCapacityPolicy() , 以及 name.

◆ hasItemDefinition()

bool eve::inventory::Inventory::hasItemDefinition ( const std::string &  itemId)

物品定义查询(显示名/堆叠/重量/体积/类别/装备槽/标签/额外属性)。

在文件 Inventory.cpp20 行定义.

引用了 eve::inventory::ItemRegistry::find().

◆ hasStackRule()

bool eve::inventory::Inventory::hasStackRule ( const std::string &  name)

在文件 Inventory.cpp91 行定义.

引用了 eve::inventory::InventorySystem::hasStackRule() , 以及 name.

◆ itemHasTag()

bool eve::inventory::Inventory::itemHasTag ( const std::string &  itemId,
const std::string &  tag 
)

在文件 Inventory.cpp54 行定义.

引用了 eve::inventory::ItemRegistry::find().

◆ Module_REG()

eve::inventory::Inventory::Module_REG ( Inventory  )

◆ newBag()

Bag * eve::inventory::Inventory::newBag ( int  slotCount)

工厂:创建容器 / 装备栏。

在文件 Inventory.cpp65 行定义.

引用了 eve::inventory::InventorySystem::ensureBuiltins().

◆ newEquipmentSet()

EquipmentSet * eve::inventory::Inventory::newEquipmentSet ( )

◆ registerItemsFromJson()

int eve::inventory::Inventory::registerItemsFromJson ( const std::string &  json)

从 JSON 注册物品定义;返回成功注册数量。

在文件 Inventory.cpp11 行定义.

引用了 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.cpp75 行定义.

引用了 eve::inventory::InventorySystem::transfer().

◆ transferSlot()

int eve::inventory::Inventory::transferSlot ( Bag from,
int  fromSlot,
Bag to,
int  quantity 
)

该类的文档由以下文件生成: