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

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

#include <Bag.h>

Public 成员函数

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

友元

class InventorySystem
 

详细描述

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

在文件 Bag.h17 行定义.

构造及析构函数说明

◆ Bag() [1/2]

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

创建指定格数的空容器。

在文件 Bag.cpp8 行定义.

◆ ~Bag()

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

◆ Bag() [2/2]

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

成员函数说明

◆ acceptTags()

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

在文件 Bag.h103 行定义.

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

◆ addAcceptTag()

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

在文件 Bag.cpp22 行定义.

◆ addItem()

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

在文件 Bag.cpp67 行定义.

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

◆ addRejectTag()

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

在文件 Bag.cpp37 行定义.

◆ addSlotTag()

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

在文件 Bag.cpp152 行定义.

引用了 getSlotCount() , 以及 s.

◆ canAddItem()

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

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

在文件 Bag.cpp57 行定义.

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

◆ canAddItemReason()

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

在文件 Bag.cpp61 行定义.

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

◆ clear()

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

在文件 Bag.cpp105 行定义.

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

◆ clearAcceptTags()

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

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

在文件 Bag.cpp20 行定义.

◆ clearRejectTags()

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

在文件 Bag.cpp35 行定义.

◆ countItem()

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

在文件 Bag.cpp87 行定义.

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

◆ destroy()

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

释放资源并使其失效。

在文件 Bag.cpp13 行定义.

◆ findItem()

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

在文件 Bag.cpp91 行定义.

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

◆ findItemByTag()

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

在文件 Bag.cpp95 行定义.

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

◆ getAcceptRule()

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

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

在文件 Bag.h49 行定义.

◆ getAcceptTag()

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

在文件 Bag.cpp30 行定义.

◆ getAcceptTagCount()

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

在文件 Bag.cpp28 行定义.

◆ getCapacityPolicy()

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

在文件 Bag.h51 行定义.

◆ getExtra()

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

在文件 Bag.cpp52 行定义.

◆ getId()

◆ getKind()

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

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

在文件 Bag.h34 行定义.

◆ getMaxVolume()

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

在文件 Bag.h45 行定义.

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

◆ getMaxWeight()

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

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

在文件 Bag.h43 行定义.

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

◆ getRejectTag()

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

在文件 Bag.cpp45 行定义.

◆ getRejectTagCount()

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

在文件 Bag.cpp43 行定义.

◆ getSlotCount()

◆ getSlotDurability()

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

在文件 Bag.cpp127 行定义.

引用了 getSlotCount().

◆ getSlotInstanceId()

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

在文件 Bag.cpp122 行定义.

引用了 getSlotCount().

◆ getSlotItemId()

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

在文件 Bag.cpp112 行定义.

引用了 getSlotCount().

◆ getSlotProp()

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

在文件 Bag.cpp137 行定义.

引用了 getSlotCount().

◆ getSlotQuantity()

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

在文件 Bag.cpp117 行定义.

引用了 getSlotCount().

◆ getStackRule()

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

在文件 Bag.h53 行定义.

◆ getUsedSlotCount()

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

在文件 Bag.cpp103 行定义.

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

◆ getUsedVolume()

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

在文件 Bag.cpp101 行定义.

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

◆ getUsedWeight()

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

在文件 Bag.cpp99 行定义.

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

◆ isSlotEmpty()

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

在文件 Bag.cpp107 行定义.

引用了 getSlotCount().

◆ moveSlot()

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

在文件 Bag.cpp79 行定义.

引用了 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

在文件 Bag.h104 行定义.

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

◆ removeAt()

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

在文件 Bag.cpp75 行定义.

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

◆ removeItem()

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

在文件 Bag.cpp71 行定义.

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

◆ setAcceptRule()

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

在文件 Bag.h50 行定义.

引用了 name.

◆ setCapacityPolicy()

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

在文件 Bag.h52 行定义.

引用了 name.

◆ setExtra()

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

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

在文件 Bag.cpp50 行定义.

引用了 value.

◆ setId()

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

在文件 Bag.h31 行定义.

引用了 id.

◆ setKind()

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

在文件 Bag.h35 行定义.

引用了 kind.

◆ setMaxVolume()

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

在文件 Bag.h46 行定义.

引用了 v.

◆ setMaxWeight()

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

在文件 Bag.h44 行定义.

引用了 w.

◆ setSlotCount()

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

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

在文件 Bag.cpp15 行定义.

◆ setSlotDurability()

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

在文件 Bag.cpp132 行定义.

引用了 getSlotCount().

◆ setSlotProp()

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

在文件 Bag.cpp142 行定义.

引用了 getSlotCount() , 以及 value.

◆ setStackRule()

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

在文件 Bag.h54 行定义.

引用了 name.

◆ slotHasTag()

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

在文件 Bag.cpp147 行定义.

引用了 getSlotCount().

◆ slots() [1/2]

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

在文件 Bag.h102 行定义.

◆ slots() [2/2]

◆ splitStack()

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

在文件 Bag.cpp83 行定义.

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

◆ swapSlots()

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

在文件 Bag.cpp77 行定义.

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

友元及相关函数文档

◆ InventorySystem

friend class InventorySystem
friend

在文件 Bag.h107 行定义.


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