Owns a production WorkQueue and borrows bag / optional equipment+actor. 更多...
#include <ForgeBench.h>
Public 成员函数 | |
| ForgeBench () | |
| ~ForgeBench () | |
| ForgeBench (const ForgeBench &)=delete | |
| ForgeBench & | operator= (const ForgeBench &)=delete |
| ForgeBench (ForgeBench &&) noexcept | |
| ForgeBench & | operator= (ForgeBench &&) noexcept |
| eve::Result< void > | bind (inventory::Bag *bag, inventory::EquipmentSet *equipment=nullptr, RPGActor *actor=nullptr) |
| Borrow the authoritative bag and optional gear/actor mirrors. @ownership Callers own bag/equipment/actor; destroy this bench first. | |
| void | unbind () |
| Clear borrowed collaborators without releasing the production queue. | |
| bool | isBound () const |
| True when a bag is currently bound. | |
| eve::Result< CraftingReceipt > | craft (CraftingRecipe recipe, std::uint32_t batchSize=1, int priority=0) |
| Atomically pay materials and enqueue a craft recipe. | |
| eve::Result< CraftingReceipt > | craftFromJson (const std::string &json, std::uint32_t batchSize=1, int priority=0) |
| Parse a craft recipe JSON object and enqueue it. | |
| eve::Result< EquipmentUpgradeReceipt > | upgrade (EquipmentUpgradeRecipe recipe, int bagSlot, int expectedInstanceId, int priority=0) |
| Atomically pay materials and enqueue an equipment upgrade. | |
| eve::Result< EquipmentUpgradeReceipt > | upgradeFromJson (const std::string &json, int bagSlot, int expectedInstanceId, int priority=0) |
| Parse an upgrade recipe JSON object and enqueue it for one bag instance. | |
| eve::Result< void > | advance (eve::SimulationTick tick, eve::Duration dt) |
| Advance the owned forge queue by one deterministic simulation step. | |
| eve::Result< int > | settle (std::string_view taskId) |
| Settle one ready craft or upgrade task into the bound bag. | |
| eve::Result< int > | settleReady () |
| Settle every ReadyToSettle / SettlementFailed task once. | |
| std::uint64_t | queueHandle () const noexcept |
| Packed production handle for diagnostics (0 when unbound/released). | |
| eve::SimulationTick | tick () const noexcept |
| Last accepted simulation tick, or zero before the first advance. | |
| int | taskCount () const |
| Task count currently retained by the forge queue. | |
| std::string | taskIdAt (int index) const |
| Task id at stable enumeration index, or empty. | |
| std::string | taskStateAt (int index) const |
| Task state name at stable enumeration index, or empty. | |
| std::string | taskKindAt (int index) const |
| Task kind at stable enumeration index, or empty. | |
| float | taskProgressAt (int index) const |
| Task progress seconds at stable enumeration index. | |
| float | taskDurationAt (int index) const |
| Task duration seconds at stable enumeration index. | |
| int | syncEquipment () const |
| Refresh actor equipment modifiers when actor+equipment are bound. | |
详细描述
Owns a production WorkQueue and borrows bag / optional equipment+actor.
Craft pays bag materials and grants outputs. Upgrade mutates one bag instance's enhance prop. When equipment + actor are bound, successful upgrade/equip paths can refresh modifiers through EquipmentSystem.
在文件 ForgeBench.h 第 37 行定义.
构造及析构函数说明
◆ ForgeBench() [1/3]
| eve::rpg::ForgeBench::ForgeBench | ( | ) |
在文件 ForgeBench.cpp 第 122 行定义.
◆ ~ForgeBench()
| eve::rpg::ForgeBench::~ForgeBench | ( | ) |
◆ ForgeBench() [2/3]
|
delete |
◆ ForgeBench() [3/3]
|
noexcept |
在文件 ForgeBench.cpp 第 133 行定义.
成员函数说明
◆ advance()
| eve::Result< void > eve::rpg::ForgeBench::advance | ( | eve::SimulationTick | tick, |
| eve::Duration | dt | ||
| ) |
Advance the owned forge queue by one deterministic simulation step.
在文件 ForgeBench.cpp 第 228 行定义.
引用了 dt, eve::Result< T >::failure() , 以及 tick().
◆ bind()
| eve::Result< void > eve::rpg::ForgeBench::bind | ( | inventory::Bag * | bag, |
| inventory::EquipmentSet * | equipment = nullptr, |
||
| RPGActor * | actor = nullptr |
||
| ) |
Borrow the authoritative bag and optional gear/actor mirrors. @ownership Callers own bag/equipment/actor; destroy this bench first.
在文件 ForgeBench.cpp 第 152 行定义.
引用了 eve::Applied, eve::Failed, eve::InvalidArgument, eve::script::RuntimeHandleRef< Tag >::isValid(), eve::Status::success() , 以及 eve::Result< T >::success().
◆ craft()
| eve::Result< CraftingReceipt > eve::rpg::ForgeBench::craft | ( | CraftingRecipe | recipe, |
| std::uint32_t | batchSize = 1, |
||
| int | priority = 0 |
||
| ) |
Atomically pay materials and enqueue a craft recipe.
在文件 ForgeBench.cpp 第 175 行定义.
引用了 account, eve::rpg::Crafting::begin(), eve::Result< T >::failure(), eve::inventory::Bag::getId(), eve::InvalidArgument, priority, eve::rpg::CraftingRequest::production, recipe , 以及 request.
被这些函数引用 craftFromJson().
◆ craftFromJson()
| eve::Result< CraftingReceipt > eve::rpg::ForgeBench::craftFromJson | ( | const std::string & | json, |
| std::uint32_t | batchSize = 1, |
||
| int | priority = 0 |
||
| ) |
Parse a craft recipe JSON object and enqueue it.
- 参数
-
json Object with id, process, ingredients, outputs[{item,quantity}], duration.
在文件 ForgeBench.cpp 第 191 行定义.
引用了 craft(), eve::Result< T >::failure(), eve::Value::fromJson(), priority, recipe , 以及 value.
◆ isBound()
|
inline |
True when a bag is currently bound.
在文件 ForgeBench.h 第 58 行定义.
◆ operator=() [1/2]
|
delete |
◆ operator=() [2/2]
|
noexcept |
在文件 ForgeBench.cpp 第 140 行定义.
引用了 eve::Result< void >::ignore() , 以及 eve::production::Production::release().
◆ queueHandle()
|
noexcept |
Packed production handle for diagnostics (0 when unbound/released).
在文件 ForgeBench.cpp 第 270 行定义.
引用了 eve::script::RuntimeHandleRef< Tag >::isValid() , 以及 eve::script::RuntimeHandleRef< Tag >::packed().
◆ settle()
| eve::Result< int > eve::rpg::ForgeBench::settle | ( | std::string_view | taskId | ) |
Settle one ready craft or upgrade task into the bound bag.
在文件 ForgeBench.cpp 第 237 行定义.
引用了 eve::Result< T >::failure(), eve::InvalidArgument, eve::NotFound, eve::rpg::EquipmentUpgrade::settle(), eve::rpg::Crafting::settle(), syncEquipment() , 以及 taskId.
被这些函数引用 settleReady().
◆ settleReady()
| eve::Result< int > eve::rpg::ForgeBench::settleReady | ( | ) |
Settle every ReadyToSettle / SettlementFailed task once.
- 返回
- Number of tasks that committed an Applied settlement.
在文件 ForgeBench.cpp 第 249 行定义.
引用了 eve::Applied, applied, eve::Result< T >::failure(), eve::InvalidArgument, eve::production::ReadyToSettle, settle(), eve::production::SettlementFailed, eve::Status::success(), eve::Result< T >::success(), taskCount() , 以及 taskId.
◆ syncEquipment()
| int eve::rpg::ForgeBench::syncEquipment | ( | ) | const |
Refresh actor equipment modifiers when actor+equipment are bound.
在文件 ForgeBench.cpp 第 312 行定义.
引用了 eve::rpg::EquipmentSystem::syncEquipModifiers().
被这些函数引用 settle().
◆ taskCount()
| int eve::rpg::ForgeBench::taskCount | ( | ) | const |
Task count currently retained by the forge queue.
在文件 ForgeBench.cpp 第 272 行定义.
被这些函数引用 settleReady().
◆ taskDurationAt()
| float eve::rpg::ForgeBench::taskDurationAt | ( | int | index | ) | const |
◆ taskIdAt()
| std::string eve::rpg::ForgeBench::taskIdAt | ( | int | index | ) | const |
◆ taskKindAt()
| std::string eve::rpg::ForgeBench::taskKindAt | ( | int | index | ) | const |
◆ taskProgressAt()
| float eve::rpg::ForgeBench::taskProgressAt | ( | int | index | ) | const |
◆ taskStateAt()
| std::string eve::rpg::ForgeBench::taskStateAt | ( | int | index | ) | const |
◆ tick()
|
inlinenoexcept |
Last accepted simulation tick, or zero before the first advance.
在文件 ForgeBench.h 第 98 行定义.
被这些函数引用 advance().
◆ unbind()
| void eve::rpg::ForgeBench::unbind | ( | ) |
Clear borrowed collaborators without releasing the production queue.
在文件 ForgeBench.cpp 第 162 行定义.
被这些函数引用 ~ForgeBench().
◆ upgrade()
| eve::Result< EquipmentUpgradeReceipt > eve::rpg::ForgeBench::upgrade | ( | EquipmentUpgradeRecipe | recipe, |
| int | bagSlot, | ||
| int | expectedInstanceId, | ||
| int | priority = 0 |
||
| ) |
Atomically pay materials and enqueue an equipment upgrade.
在文件 ForgeBench.cpp 第 199 行定义.
引用了 account, bagSlot, eve::rpg::EquipmentUpgrade::begin(), eve::Result< T >::failure(), eve::inventory::Bag::getId(), eve::InvalidArgument, priority, eve::rpg::EquipmentUpgradeRequest::production, recipe , 以及 request.
被这些函数引用 upgradeFromJson().
◆ upgradeFromJson()
| eve::Result< EquipmentUpgradeReceipt > eve::rpg::ForgeBench::upgradeFromJson | ( | const std::string & | json, |
| int | bagSlot, | ||
| int | expectedInstanceId, | ||
| int | priority = 0 |
||
| ) |
Parse an upgrade recipe JSON object and enqueue it for one bag instance.
- 参数
-
json Object with id, process, itemId, fromLevel, toLevel, ingredients, duration.
在文件 ForgeBench.cpp 第 219 行定义.
引用了 bagSlot, eve::Result< T >::failure(), eve::Value::fromJson(), priority, recipe, upgrade() , 以及 value.
该类的文档由以下文件生成:
- src/modules/rpg/ForgeBench.h
- src/modules/rpg/ForgeBench.cpp