载入中...
搜索中...
未找到
eve::inventory::ItemStack结构体 参考

容器中的一格堆叠(空槽:itemId 为空或 quantity <= 0)。 更多...

#include <ItemTypes.h>

Public 成员函数

bool empty () const
 
void clear ()
 
bool hasTag (const std::string &tag) const
 
std::string getProp (const std::string &key, const std::string &fallback={}) const
 
void setProp (const std::string &key, const std::string &value)
 

Public 属性

int instanceId = 0
 
std::string itemId
 
int quantity = 0
 
float durability = -1.f
 < 0 表示不适用
 
std::unordered_map< std::string, std::string > props
 
std::vector< std::string > tags
 

详细描述

容器中的一格堆叠(空槽:itemId 为空或 quantity <= 0)。

在文件 ItemTypes.h30 行定义.

成员函数说明

◆ clear()

void eve::inventory::ItemStack::clear ( )

在文件 Item.cpp20 行定义.

引用了 durability, instanceId, itemId, props, quantity , 以及 tags.

被这些函数引用 eve::inventory::InventorySystem::equipFromBag().

◆ empty()

bool eve::inventory::ItemStack::empty ( ) const
inline

在文件 ItemTypes.h38 行定义.

引用了 itemId , 以及 quantity.

◆ getProp()

std::string eve::inventory::ItemStack::getProp ( const std::string &  key,
const std::string &  fallback = {} 
) const

在文件 Item.cpp33 行定义.

引用了 props.

◆ hasTag()

bool eve::inventory::ItemStack::hasTag ( const std::string &  tag) const

在文件 Item.cpp29 行定义.

引用了 tags.

◆ setProp()

void eve::inventory::ItemStack::setProp ( const std::string &  key,
const std::string &  value 
)

在文件 Item.cpp38 行定义.

引用了 props , 以及 value.

类成员变量说明

◆ durability

float eve::inventory::ItemStack::durability = -1.f

< 0 表示不适用

在文件 ItemTypes.h34 行定义.

被这些函数引用 clear().

◆ instanceId

int eve::inventory::ItemStack::instanceId = 0

在文件 ItemTypes.h31 行定义.

被这些函数引用 clear().

◆ itemId

std::string eve::inventory::ItemStack::itemId

在文件 ItemTypes.h32 行定义.

被这些函数引用 clear(), empty() , 以及 eve::inventory::InventorySystem::unequipToBag().

◆ props

std::unordered_map<std::string, std::string> eve::inventory::ItemStack::props

在文件 ItemTypes.h35 行定义.

被这些函数引用 clear(), getProp() , 以及 setProp().

◆ quantity

int eve::inventory::ItemStack::quantity = 0

在文件 ItemTypes.h33 行定义.

被这些函数引用 clear() , 以及 empty().

◆ tags

std::vector<std::string> eve::inventory::ItemStack::tags

在文件 ItemTypes.h36 行定义.

被这些函数引用 clear() , 以及 hasTag().


该结构体的文档由以下文件生成: