Product transaction boundary for persistent world-object rewards. 更多...
#include <WorldInteraction.h>
静态 Public 成员函数 | |
| static eve::Result< int > | collectLoot (GameState &gameState, Tracker &tracker, inventory::Bag &bag, const WorldLootRequest &request) |
| Atomically grant loot, notify quest progress, and consume one world object. | |
详细描述
Product transaction boundary for persistent world-object rewards.
在文件 WorldInteraction.h 第 38 行定义.
成员函数说明
◆ collectLoot()
|
static |
Atomically grant loot, notify quest progress, and consume one world object.
- 参数
-
gameState Borrowed owner of attributes and persistent world facts. tracker Borrowed quest-progress owner. bag Borrowed inventory owner. request Validated interaction description; omitted effects use empty id and zero amount.
- 返回
- Number of committed effects, or a structured failure with every owner unchanged.
- 备注
- A required quest must be active. The object must not already be consumed. Inventory hooks run only after attribute, quest, world and inventory state are final. @ownership All participants remain caller-owned and must outlive this call. @thread Call on the participants' owning simulation thread; concurrent mutation is unsupported. @reentrancy Inventory hooks may re-enter only after the no-fail commit boundary.
在文件 WorldInteraction.cpp 第 37 行定义.
引用了 eve::rpg::GameState::addVariable(), eve::Applied, eve::inventory::InventorySystem::commitAddBatch(), eve::Conflict, consumed, eve::rpg::WorldState::consumeObject(), eve::rpg::Tracker::entries, eve::Result< T >::failure(), eve::rpg::Tracker::getState(), eve::rpg::GameState::getVariable(), eve::InvalidArgument, eve::InvariantViolation, eve::rpg::WorldState::isObjectConsumed(), eve::rpg::Tracker::notify(), eve::Result< void >::ok(), eve::rpg::Tracker::order, eve::rpg::Tracker::pending, eve::rpg::Tracker::polled, eve::PreconditionViolation, eve::inventory::InventorySystem::prepareAddBatch(), request, eve::rpg::GameState::restoreSnapshotJson(), eve::rpg::GameState::snapshotJson(), eve::Status::success(), eve::Result< T >::success() , 以及 world.
被这些函数引用 eve::rpg::RPG::collectWorldLoot() , 以及 eve::rpg::ProductControl::submitGameplay().
该类的文档由以下文件生成:
- src/modules/rpg/WorldInteraction.h
- src/modules/rpg/WorldInteraction.cpp