格子型物品容器(脚本可直接操作)。 更多...
#include <Bag.h>
Public 成员函数 | |
| Bag (int slotCount) | |
| 创建指定格数的空容器。 | |
| ~Bag ()=default | |
| Bag (const Bag &)=delete | |
| Bag & | operator= (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() [1/2]
◆ ~Bag()
|
default |
◆ Bag() [2/2]
|
delete |
成员函数说明
◆ acceptTags()
|
inline |
◆ addAcceptTag()
◆ addItem()
| int eve::inventory::Bag::addItem | ( | const std::string & | itemId, |
| int | quantity | ||
| ) |
◆ addRejectTag()
◆ addSlotTag()
| void eve::inventory::Bag::addSlotTag | ( | int | slot, |
| const std::string & | tag | ||
| ) |
引用了 getSlotCount() , 以及 s.
◆ canAddItem()
| bool eve::inventory::Bag::canAddItem | ( | const std::string & | itemId, |
| int | quantity | ||
| ) |
便捷操作(转发 InventorySystem):增删 / 移动 / 查询。
◆ canAddItemReason()
| std::string eve::inventory::Bag::canAddItemReason | ( | const std::string & | itemId, |
| int | quantity | ||
| ) |
◆ clear()
| void eve::inventory::Bag::clear | ( | ) |
◆ clearAcceptTags()
◆ clearRejectTags()
◆ countItem()
| int eve::inventory::Bag::countItem | ( | const std::string & | itemId | ) | const |
◆ destroy()
◆ findItem()
| int eve::inventory::Bag::findItem | ( | const std::string & | itemId | ) | const |
◆ findItemByTag()
| int eve::inventory::Bag::findItemByTag | ( | const std::string & | tag | ) | const |
◆ getAcceptRule()
|
inline |
◆ getAcceptTag()
◆ getAcceptTagCount()
◆ getCapacityPolicy()
◆ getExtra()
| std::string eve::inventory::Bag::getExtra | ( | const std::string & | key, |
| const std::string & | fallback = {} |
||
| ) | const |
◆ getId()
|
inline |
容器 id(变更事件定位用)。
被这些函数引用 eve::inventory::InventorySystem::addItem(), eve::inventory::InventorySystem::clearBag(), eve::inventory::InventorySystem::equipFromBag(), eve::inventory::InventorySystem::moveSlot(), eve::inventory::InventorySystem::removeAt(), eve::inventory::InventorySystem::removeItem(), eve::inventory::InventorySystem::splitStack(), eve::inventory::InventorySystem::swapSlots(), eve::inventory::InventorySystem::transfer(), eve::inventory::InventorySystem::transferSlot() , 以及 eve::inventory::InventorySystem::unequipToBag().
◆ getKind()
|
inline |
◆ getMaxVolume()
|
inline |
◆ getMaxWeight()
|
inline |
◆ getRejectTag()
◆ getRejectTagCount()
◆ getSlotCount()
|
inline |
格数。
被这些函数引用 eve::inventory::InventorySystem::addItem(), addSlotTag(), eve::inventory::EquipmentSet::canEquipFromBag(), eve::inventory::InventorySystem::ensureBuiltins(), eve::inventory::InventorySystem::findItem(), eve::inventory::InventorySystem::findItemByTag(), getSlotDurability(), getSlotInstanceId(), getSlotItemId(), getSlotProp(), getSlotQuantity(), isSlotEmpty(), eve::inventory::InventorySystem::moveSlot(), eve::inventory::InventorySystem::removeAt(), eve::inventory::InventorySystem::removeItem(), setSlotDurability(), setSlotProp(), slotHasTag(), eve::inventory::InventorySystem::splitStack(), eve::inventory::InventorySystem::swapSlots(), eve::inventory::InventorySystem::transfer(), eve::inventory::InventorySystem::transferSlot() , 以及 eve::inventory::InventorySystem::unequipToBag().
◆ getSlotDurability()
| float eve::inventory::Bag::getSlotDurability | ( | int | slot | ) | const |
引用了 getSlotCount().
◆ getSlotInstanceId()
| int eve::inventory::Bag::getSlotInstanceId | ( | int | slot | ) | const |
引用了 getSlotCount().
◆ getSlotItemId()
| std::string eve::inventory::Bag::getSlotItemId | ( | int | slot | ) | const |
引用了 getSlotCount().
◆ getSlotProp()
| std::string eve::inventory::Bag::getSlotProp | ( | int | slot, |
| const std::string & | key, | ||
| const std::string & | fallback = {} |
||
| ) | const |
引用了 getSlotCount().
◆ getSlotQuantity()
| int eve::inventory::Bag::getSlotQuantity | ( | int | slot | ) | const |
引用了 getSlotCount().
◆ getStackRule()
◆ getUsedSlotCount()
| int eve::inventory::Bag::getUsedSlotCount | ( | ) | const |
◆ getUsedVolume()
| float eve::inventory::Bag::getUsedVolume | ( | ) | const |
◆ getUsedWeight()
| float eve::inventory::Bag::getUsedWeight | ( | ) | const |
◆ isSlotEmpty()
| bool eve::inventory::Bag::isSlotEmpty | ( | int | slot | ) | const |
引用了 getSlotCount().
◆ moveSlot()
| bool eve::inventory::Bag::moveSlot | ( | int | fromSlot, |
| int | toSlot | ||
| ) |
◆ operator=()
◆ rejectTags()
|
inline |
◆ removeAt()
| int eve::inventory::Bag::removeAt | ( | int | slot, |
| int | quantity | ||
| ) |
◆ removeItem()
| int eve::inventory::Bag::removeItem | ( | const std::string & | itemId, |
| int | quantity | ||
| ) |
◆ setAcceptRule()
|
inline |
◆ setCapacityPolicy()
|
inline |
◆ setExtra()
| void eve::inventory::Bag::setExtra | ( | const std::string & | key, |
| const std::string & | value | ||
| ) |
◆ setId()
◆ setKind()
◆ setMaxVolume()
◆ setMaxWeight()
◆ setSlotCount()
| void eve::inventory::Bag::setSlotCount | ( | int | slotCount | ) |
◆ setSlotDurability()
| void eve::inventory::Bag::setSlotDurability | ( | int | slot, |
| float | durability | ||
| ) |
引用了 getSlotCount().
◆ setSlotProp()
| void eve::inventory::Bag::setSlotProp | ( | int | slot, |
| const std::string & | key, | ||
| const std::string & | value | ||
| ) |
引用了 getSlotCount() , 以及 value.
◆ setStackRule()
|
inline |
◆ slotHasTag()
| bool eve::inventory::Bag::slotHasTag | ( | int | slot, |
| const std::string & | tag | ||
| ) | const |
引用了 getSlotCount().
◆ slots() [1/2]
◆ slots() [2/2]
|
inline |
被这些函数引用 eve::inventory::InventorySystem::addItem(), eve::inventory::EquipmentSet::canEquipFromBag(), eve::inventory::InventorySystem::clearBag(), eve::inventory::InventorySystem::countItem(), eve::inventory::InventorySystem::equipFromBag(), eve::inventory::InventorySystem::findItem(), eve::inventory::InventorySystem::findItemByTag(), eve::inventory::InventorySystem::moveSlot(), eve::inventory::InventorySystem::removeAt(), eve::inventory::InventorySystem::removeItem(), eve::inventory::InventorySystem::splitStack(), eve::inventory::InventorySystem::swapSlots(), eve::inventory::InventorySystem::transfer(), eve::inventory::InventorySystem::transferSlot(), eve::inventory::InventorySystem::unequipToBag(), eve::inventory::InventorySystem::usedSlotCount(), eve::inventory::InventorySystem::usedVolume() , 以及 eve::inventory::InventorySystem::usedWeight().
◆ splitStack()
| bool eve::inventory::Bag::splitStack | ( | int | slot, |
| int | quantity, | ||
| int | toSlot | ||
| ) |
◆ swapSlots()
| bool eve::inventory::Bag::swapSlots | ( | int | slotA, |
| int | slotB | ||
| ) |
友元及相关函数文档
◆ InventorySystem
|
friend |
该类的文档由以下文件生成: