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

格子型物品容器(脚本可直接操作)。 更多...

#include <Bag.h>

Public 成员函数

 Bag (int slotCount)
 创建指定格数的空容器。
 
 ~Bag ()=default
 Bag.
 
 Bag (const Bag &)=delete
 
Bag & operator= (const Bag &)=delete
 
void destroy ()
 释放资源并使其失效。
 
std::string getId () const
 容器 id(变更事件定位用)。
 
void setId (const std::string &id)
 Sets the id.
 
std::string getKind () const
 容器种类(bag / chest / shop 等)。
 
void setKind (const std::string &kind)
 Sets the kind.
 
int getSlotCount () const
 格数。
 
void setSlotCount (int slotCount)
 调整格数:扩容追加空槽;缩容会丢弃被裁掉的槽(不自动转移)。
 
float getMaxWeight () const
 重量 / 体积上限(容量策略用)。
 
void setMaxWeight (float w)
 Sets the max weight.
 
float getMaxVolume () const
 Returns the max volume.
 
void setMaxVolume (float v)
 Sets the max volume.
 
std::string getAcceptRule () const
 接受规则 / 容量策略 / 堆叠规则名。
 
void setAcceptRule (const std::string &name)
 Sets the accept rule.
 
std::string getCapacityPolicy () const
 Returns the capacity policy.
 
void setCapacityPolicy (const std::string &name)
 Sets the capacity policy.
 
std::string getStackRule () const
 Returns the stack rule.
 
void setStackRule (const std::string &name)
 Sets the stack rule.
 
void clearAcceptTags ()
 可接受 / 拒绝的标签过滤。
 
void addAcceptTag (const std::string &tag)
 Adds accept tag.
 
int getAcceptTagCount () const
 Returns the accept tag count.
 
std::string getAcceptTag (int index) const
 Returns the accept tag.
 
void clearRejectTags ()
 Clears reject tags.
 
void addRejectTag (const std::string &tag)
 Adds reject tag.
 
int getRejectTagCount () const
 Returns the reject tag count.
 
std::string getRejectTag (int index) const
 Returns the reject tag.
 
void setExtra (const std::string &key, const std::string &value)
 容器级额外属性(键值)。
 
std::string getExtra (const std::string &key, const std::string &fallback={}) const
 Returns the extra.
 
bool canAddItem (const std::string &itemId, int quantity)
 便捷操作(转发 InventorySystem):增删 / 移动 / 查询。
 
std::string canAddItemReason (const std::string &itemId, int quantity)
 Can add item reason.
 
int addItem (const std::string &itemId, int quantity)
 Adds item.
 
int removeItem (const std::string &itemId, int quantity)
 Removes item.
 
int removeAt (int slot, int quantity)
 Removes at.
 
bool swapSlots (int slotA, int slotB)
 Swap slots.
 
bool moveSlot (int fromSlot, int toSlot)
 Moves slot.
 
bool splitStack (int slot, int quantity, int toSlot)
 Split stack.
 
int countItem (const std::string &itemId) const
 Returns the number of item.
 
int findItem (const std::string &itemId) const
 Finds item.
 
int findItemByTag (const std::string &tag) const
 Finds item by tag.
 
float getUsedWeight () const
 Returns the used weight.
 
float getUsedVolume () const
 Returns the used volume.
 
int getUsedSlotCount () const
 Returns the used slot count.
 
void clear ()
 Clears clear.
 
bool isSlotEmpty (int slot) const
 True when slot empty.
 
std::string getSlotItemId (int slot) const
 Returns the slot item id.
 
int getSlotQuantity (int slot) const
 Returns the slot quantity.
 
int getSlotInstanceId (int slot) const
 Returns the slot instance id.
 
float getSlotDurability (int slot) const
 Returns the slot durability.
 
void setSlotDurability (int slot, float durability)
 Sets the slot durability.
 
std::string getSlotProp (int slot, const std::string &key, const std::string &fallback={}) const
 Returns the slot prop.
 
void setSlotProp (int slot, const std::string &key, const std::string &value)
 Sets the slot prop.
 
bool slotHasTag (int slot, const std::string &tag) const
 Slot has tag.
 
void addSlotTag (int slot, const std::string &tag)
 Adds slot tag.
 
const std::vector< ItemStack > & slots () const
 Slots.
 
std::vector< ItemStack > & slots ()
 Slots.
 
const std::vector< std::string > & acceptTags () const
 Accept tags.
 
const std::vector< std::string > & rejectTags () const
 Reject tags.
 

友元

class InventorySystem
 
class InventorySaveSession
 

详细描述

格子型物品容器(脚本可直接操作)。

在文件 Bag.h 第 21 行定义.

构造及析构函数说明

◆ Bag() [1/2]

eve::inventory::Bag::Bag ( int  slotCount)

创建指定格数的空容器。

在文件 Bag.cpp 第 8 行定义.

◆ ~Bag()

eve::inventory::Bag::~Bag ( )
default

Bag.

◆ Bag() [2/2]

eve::inventory::Bag::Bag ( const Bag &  )
delete

成员函数说明

◆ acceptTags()

const std::vector< std::string > & eve::inventory::Bag::acceptTags ( ) const
inline

Accept tags.

在文件 Bag.h 第 153 行定义.

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

◆ addAcceptTag()

void eve::inventory::Bag::addAcceptTag ( const std::string &  tag)

Adds accept tag.

在文件 Bag.cpp 第 22 行定义.

引用了 tag.

◆ addItem()

int eve::inventory::Bag::addItem ( const std::string &  itemId,
int  quantity 
)

Adds item.

在文件 Bag.cpp 第 67 行定义.

引用了 eve::inventory::InventorySystem::addItem() , 以及 itemId.

被这些函数引用 eve::rpg::LootSystem::roll() , 以及 eve::inventory::InventoryControl::submitGameplay().

◆ addRejectTag()

void eve::inventory::Bag::addRejectTag ( const std::string &  tag)

Adds reject tag.

在文件 Bag.cpp 第 37 行定义.

引用了 tag.

◆ addSlotTag()

void eve::inventory::Bag::addSlotTag ( int  slot,
const std::string &  tag 
)

Adds slot tag.

在文件 Bag.cpp 第 152 行定义.

引用了 getSlotCount(), s , 以及 tag.

◆ canAddItem()

bool eve::inventory::Bag::canAddItem ( const std::string &  itemId,
int  quantity 
)

便捷操作(转发 InventorySystem):增删 / 移动 / 查询。

在文件 Bag.cpp 第 57 行定义.

引用了 eve::inventory::InventorySystem::canAdd() , 以及 itemId.

被这些函数引用 eve::inventory::InventoryControl::submitGameplay().

◆ canAddItemReason()

std::string eve::inventory::Bag::canAddItemReason ( const std::string &  itemId,
int  quantity 
)

Can add item reason.

在文件 Bag.cpp 第 61 行定义.

引用了 eve::inventory::InventorySystem::canAdd() , 以及 itemId.

被这些函数引用 eve::inventory::InventoryControl::submitGameplay().

◆ clear()

void eve::inventory::Bag::clear ( )

Clears clear.

在文件 Bag.cpp 第 105 行定义.

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

◆ clearAcceptTags()

void eve::inventory::Bag::clearAcceptTags ( )

可接受 / 拒绝的标签过滤。

在文件 Bag.cpp 第 20 行定义.

◆ clearRejectTags()

void eve::inventory::Bag::clearRejectTags ( )

Clears reject tags.

在文件 Bag.cpp 第 35 行定义.

◆ countItem()

int eve::inventory::Bag::countItem ( const std::string &  itemId) const

Returns the number of item.

在文件 Bag.cpp 第 87 行定义.

引用了 eve::inventory::InventorySystem::countItem() , 以及 itemId.

◆ destroy()

void eve::inventory::Bag::destroy ( )

释放资源并使其失效。

在文件 Bag.cpp 第 13 行定义.

◆ findItem()

int eve::inventory::Bag::findItem ( const std::string &  itemId) const

Finds item.

在文件 Bag.cpp 第 91 行定义.

引用了 eve::inventory::InventorySystem::findItem() , 以及 itemId.

◆ findItemByTag()

int eve::inventory::Bag::findItemByTag ( const std::string &  tag) const

Finds item by tag.

在文件 Bag.cpp 第 95 行定义.

引用了 eve::inventory::InventorySystem::findItemByTag() , 以及 tag.

◆ getAcceptRule()

std::string eve::inventory::Bag::getAcceptRule ( ) const
inline

接受规则 / 容量策略 / 堆叠规则名。

在文件 Bag.h 第 59 行定义.

◆ getAcceptTag()

std::string eve::inventory::Bag::getAcceptTag ( int  index) const

Returns the accept tag.

在文件 Bag.cpp 第 30 行定义.

引用了 index.

◆ getAcceptTagCount()

int eve::inventory::Bag::getAcceptTagCount ( ) const

Returns the accept tag count.

在文件 Bag.cpp 第 28 行定义.

◆ getCapacityPolicy()

std::string eve::inventory::Bag::getCapacityPolicy ( ) const
inline

Returns the capacity policy.

在文件 Bag.h 第 63 行定义.

◆ getExtra()

std::string eve::inventory::Bag::getExtra ( const std::string &  key,
const std::string &  fallback = {} 
) const

Returns the extra.

在文件 Bag.cpp 第 52 行定义.

引用了 key.

◆ getId()

◆ getKind()

std::string eve::inventory::Bag::getKind ( ) const
inline

容器种类(bag / chest / shop 等)。

在文件 Bag.h 第 40 行定义.

◆ getMaxVolume()

float eve::inventory::Bag::getMaxVolume ( ) const
inline

Returns the max volume.

在文件 Bag.h 第 54 行定义.

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

◆ getMaxWeight()

float eve::inventory::Bag::getMaxWeight ( ) const
inline

重量 / 体积上限(容量策略用)。

在文件 Bag.h 第 50 行定义.

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

◆ getRejectTag()

std::string eve::inventory::Bag::getRejectTag ( int  index) const

Returns the reject tag.

在文件 Bag.cpp 第 45 行定义.

引用了 index.

◆ getRejectTagCount()

int eve::inventory::Bag::getRejectTagCount ( ) const

Returns the reject tag count.

在文件 Bag.cpp 第 43 行定义.

◆ getSlotCount()

◆ getSlotDurability()

float eve::inventory::Bag::getSlotDurability ( int  slot) const

Returns the slot durability.

在文件 Bag.cpp 第 127 行定义.

引用了 getSlotCount().

◆ getSlotInstanceId()

int eve::inventory::Bag::getSlotInstanceId ( int  slot) const

Returns the slot instance id.

在文件 Bag.cpp 第 122 行定义.

引用了 getSlotCount().

◆ getSlotItemId()

std::string eve::inventory::Bag::getSlotItemId ( int  slot) const

Returns the slot item id.

在文件 Bag.cpp 第 112 行定义.

引用了 getSlotCount().

◆ getSlotProp()

std::string eve::inventory::Bag::getSlotProp ( int  slot,
const std::string &  key,
const std::string &  fallback = {} 
) const

Returns the slot prop.

在文件 Bag.cpp 第 137 行定义.

引用了 getSlotCount() , 以及 key.

◆ getSlotQuantity()

int eve::inventory::Bag::getSlotQuantity ( int  slot) const

Returns the slot quantity.

在文件 Bag.cpp 第 117 行定义.

引用了 getSlotCount().

◆ getStackRule()

std::string eve::inventory::Bag::getStackRule ( ) const
inline

Returns the stack rule.

在文件 Bag.h 第 67 行定义.

◆ getUsedSlotCount()

int eve::inventory::Bag::getUsedSlotCount ( ) const

Returns the used slot count.

在文件 Bag.cpp 第 103 行定义.

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

◆ getUsedVolume()

float eve::inventory::Bag::getUsedVolume ( ) const

Returns the used volume.

在文件 Bag.cpp 第 101 行定义.

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

◆ getUsedWeight()

float eve::inventory::Bag::getUsedWeight ( ) const

Returns the used weight.

在文件 Bag.cpp 第 99 行定义.

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

◆ isSlotEmpty()

bool eve::inventory::Bag::isSlotEmpty ( int  slot) const

True when slot empty.

在文件 Bag.cpp 第 107 行定义.

引用了 getSlotCount().

◆ moveSlot()

bool eve::inventory::Bag::moveSlot ( int  fromSlot,
int  toSlot 
)

Moves slot.

在文件 Bag.cpp 第 79 行定义.

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

◆ operator=()

Bag & eve::inventory::Bag::operator= ( const Bag &  )
delete

◆ rejectTags()

const std::vector< std::string > & eve::inventory::Bag::rejectTags ( ) const
inline

Reject tags.

在文件 Bag.h 第 155 行定义.

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

◆ removeAt()

int eve::inventory::Bag::removeAt ( int  slot,
int  quantity 
)

Removes at.

在文件 Bag.cpp 第 75 行定义.

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

◆ removeItem()

int eve::inventory::Bag::removeItem ( const std::string &  itemId,
int  quantity 
)

Removes item.

在文件 Bag.cpp 第 71 行定义.

引用了 itemId , 以及 eve::inventory::InventorySystem::removeItem().

被这些函数引用 eve::inventory::InventoryControl::submitGameplay().

◆ setAcceptRule()

void eve::inventory::Bag::setAcceptRule ( const std::string &  name)
inline

Sets the accept rule.

在文件 Bag.h 第 61 行定义.

引用了 name.

◆ setCapacityPolicy()

void eve::inventory::Bag::setCapacityPolicy ( const std::string &  name)
inline

Sets the capacity policy.

在文件 Bag.h 第 65 行定义.

引用了 name.

◆ setExtra()

void eve::inventory::Bag::setExtra ( const std::string &  key,
const std::string &  value 
)

容器级额外属性(键值)。

在文件 Bag.cpp 第 50 行定义.

引用了 key , 以及 value.

◆ setId()

void eve::inventory::Bag::setId ( const std::string &  id)
inline

Sets the id.

在文件 Bag.h 第 37 行定义.

引用了 id.

◆ setKind()

void eve::inventory::Bag::setKind ( const std::string &  kind)
inline

Sets the kind.

在文件 Bag.h 第 42 行定义.

引用了 kind.

◆ setMaxVolume()

void eve::inventory::Bag::setMaxVolume ( float  v)
inline

Sets the max volume.

在文件 Bag.h 第 56 行定义.

引用了 v.

◆ setMaxWeight()

void eve::inventory::Bag::setMaxWeight ( float  w)
inline

Sets the max weight.

在文件 Bag.h 第 52 行定义.

引用了 w.

◆ setSlotCount()

void eve::inventory::Bag::setSlotCount ( int  slotCount)

调整格数:扩容追加空槽;缩容会丢弃被裁掉的槽(不自动转移)。

在文件 Bag.cpp 第 15 行定义.

◆ setSlotDurability()

void eve::inventory::Bag::setSlotDurability ( int  slot,
float  durability 
)

Sets the slot durability.

在文件 Bag.cpp 第 132 行定义.

引用了 getSlotCount().

◆ setSlotProp()

void eve::inventory::Bag::setSlotProp ( int  slot,
const std::string &  key,
const std::string &  value 
)

Sets the slot prop.

在文件 Bag.cpp 第 142 行定义.

引用了 getSlotCount(), key , 以及 value.

◆ setStackRule()

void eve::inventory::Bag::setStackRule ( const std::string &  name)
inline

Sets the stack rule.

在文件 Bag.h 第 69 行定义.

引用了 name.

◆ slotHasTag()

bool eve::inventory::Bag::slotHasTag ( int  slot,
const std::string &  tag 
) const

Slot has tag.

在文件 Bag.cpp 第 147 行定义.

引用了 getSlotCount() , 以及 tag.

◆ slots() [1/2]

std::vector< ItemStack > & eve::inventory::Bag::slots ( )
inline

Slots.

在文件 Bag.h 第 151 行定义.

◆ slots() [2/2]

◆ splitStack()

bool eve::inventory::Bag::splitStack ( int  slot,
int  quantity,
int  toSlot 
)

Split stack.

在文件 Bag.cpp 第 83 行定义.

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

被这些函数引用 eve::inventory::InventoryControl::submitGameplay().

◆ swapSlots()

bool eve::inventory::Bag::swapSlots ( int  slotA,
int  slotB 
)

Swap slots.

在文件 Bag.cpp 第 77 行定义.

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

友元及相关函数文档

◆ InventorySaveSession

friend class InventorySaveSession
friend

在文件 Bag.h 第 159 行定义.

◆ InventorySystem

friend class InventorySystem
friend

在文件 Bag.h 第 158 行定义.


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