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

Exposes the module's published player inventories through the shared gameplay command protocol. 更多...

#include <InventoryControl.h>

类 eve::inventory::InventoryControl 继承关系图:
eve::IGameplayControlProvider eve::IGameplayInstanceCatalog

Public 成员函数

 InventoryControl ()
 Create an unpublished adapter and register it as the inventory domain.
 
 ~InventoryControl () override
 Unpublish every instance without destroying borrowed authorities.
 
 InventoryControl (const InventoryControl &)=delete
 
InventoryControl & operator= (const InventoryControl &)=delete
 
Result< void > publish (SubjectRef instance, SubjectRef owner, Bag &bag, EquipmentSet *equipment)
 Publish one borrowed inventory instance under a stable identity.
 
Result< void > unpublish (SubjectRef instance)
 Drop one publication; NotFound when that instance is not published.
 
void clear ()
 Drop every publication without destroying borrowed containers.
 
int count () const
 Number of published instances.
 
std::vector< SubjectRef > instances () const
 Published instance identities, in publication order.
 
std::string_view gameplayDomain () const noexcept override
 Stable provider domain used for discovery and routing.
 
std::vector< SubjectRef > gameplayInstances () const override
 Instances currently served, in publication order.
 
Result< GameplayObservation > observeGameplay (const GameplaySession &session, SubjectRef instance) const override
 Observe one provider-owned gameplay instance without mutation.
 
Result< std::vector< GameplayActionDescriptor > > availableGameplayActions (const GameplaySession &session, SubjectRef instance, SubjectRef subject) const override
 Discover currently legal player-semantic actions for one subject.
 
Result< GameplayCommandReceipt > submitGameplay (const GameplaySession &session, SubjectRef instance, const GameplayCommand &command) override
 Validate authority and atomically submit one domain command.
 
Result< GameplayObservation > advanceGameplay (const GameplaySession &session, SubjectRef instance, const SimulationStep &step) override
 Advance one provider-owned instance using injected deterministic time.
 
Result< std::vector< GameplayEvent > > gameplayEvents (const GameplaySession &session, SubjectRef instance, std::uint64_t afterSequence) const override
 Return events strictly newer than an instance-local sequence cursor.
 
- Public 成员函数 继承自 eve::IGameplayControlProvider
virtual ~IGameplayControlProvider ()=default
 Releases IGameplayControlProvider resources.
 
- Public 成员函数 继承自 eve::IGameplayInstanceCatalog
virtual ~IGameplayInstanceCatalog ()=default
 Releases IGameplayInstanceCatalog resources.
 

额外继承的成员函数

- 静态 Public 属性 继承自 eve::IGameplayControlProvider
static constexpr const char * capabilityName = "IGameplayControlProvider"
 
- 静态 Public 属性 继承自 eve::IGameplayInstanceCatalog
static constexpr const char * capabilityName = "IGameplayInstanceCatalog"
 

详细描述

Exposes the module's published player inventories through the shared gameplay command protocol.

Until now the inventory domain had no player-equivalent agent surface at all: eve_gameplay could not reach it, so an unattended agent had to fall back to eve_eval against bag internals. The action vocabulary here is the module's own vocabulary; add/remove/split/equip/unequip map one-to-one onto Bag and EquipmentSet operations, not onto a new write path invented by the adapter.

One adapter serves every published instance, because the shared router requires exactly one provider per domain: a per-instance listener would make the second published inventory unusable for everyone.

Authority: inventory:add-item is a grant, so it is refused for GameplayAccess::PlayerEquivalent and only accepted for the test-driver and developer-cheat profiles. Every other action is player-equivalent and requires the session to control the instance owner.

Partial effects stay observable: inventory:remove-item keeps the Bag take-up-to-N contract, so a request for more than the container holds applies what it can and reports the applied amount as quantity in the receipt and event instead of silently claiming the full requested amount.

@ownership Published bags and equipment sets are borrowed authorities that must outlive their publication; the adapter copies no inventory state and keeps only per-instance revision and event ledgers. clear() drops the publications without touching the containers. @thread Owner-simulation thread only, like every gameplay provider. @reentrancy No method invokes callbacks; submitGameplay mutates the borrowed bag/equipment directly and appends to its own event ledger.

在文件 InventoryControl.h 第 47 行定义.

构造及析构函数说明

◆ InventoryControl() [1/2]

eve::inventory::InventoryControl::InventoryControl ( )

Create an unpublished adapter and register it as the inventory domain.

在文件 InventoryControl.cpp 第 55 行定义.

◆ ~InventoryControl()

eve::inventory::InventoryControl::~InventoryControl ( )
override

Unpublish every instance without destroying borrowed authorities.

在文件 InventoryControl.cpp 第 60 行定义.

◆ InventoryControl() [2/2]

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

成员函数说明

◆ advanceGameplay()

Result< GameplayObservation > eve::inventory::InventoryControl::advanceGameplay ( const GameplaySession &  session,
SubjectRef  instance,
const SimulationStep &  step 
)
overridevirtual

Advance one provider-owned instance using injected deterministic time.

Advance gameplay.

实现了 eve::IGameplayControlProvider.

在文件 InventoryControl.cpp 第 380 行定义.

引用了 eve::Conflict, eve::Result< T >::failure(), eve::NotFound, observeGameplay(), session , 以及 step.

◆ availableGameplayActions()

Result< std::vector< GameplayActionDescriptor > > eve::inventory::InventoryControl::availableGameplayActions ( const GameplaySession &  session,
SubjectRef  instance,
SubjectRef  subject 
) const
overridevirtual

Discover currently legal player-semantic actions for one subject.

Available gameplay actions.

实现了 eve::IGameplayControlProvider.

在文件 InventoryControl.cpp 第 193 行定义.

引用了 actions, id, eve::NotFound, observeGameplay(), eve::PlayerEquivalent, eve::PreconditionViolation, session , 以及 subject.

◆ clear()

void eve::inventory::InventoryControl::clear ( )

Drop every publication without destroying borrowed containers.

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

◆ count()

int eve::inventory::InventoryControl::count ( ) const

Number of published instances.

在文件 InventoryControl.cpp 第 93 行定义.

◆ gameplayDomain()

std::string_view eve::inventory::InventoryControl::gameplayDomain ( ) const
overridevirtualnoexcept

Stable provider domain used for discovery and routing.

Gameplay domain.

实现了 eve::IGameplayControlProvider.

在文件 InventoryControl.cpp 第 114 行定义.

◆ gameplayEvents()

Result< std::vector< GameplayEvent > > eve::inventory::InventoryControl::gameplayEvents ( const GameplaySession &  session,
SubjectRef  instance,
std::uint64_t  afterSequence 
) const
overridevirtual

Return events strictly newer than an instance-local sequence cursor.

Gameplay events.

实现了 eve::IGameplayControlProvider.

在文件 InventoryControl.cpp 第 395 行定义.

引用了 eve::Applied, eve::NoOp, eve::NotFound, observeGameplay(), session , 以及 eve::Status::success().

◆ gameplayInstances()

std::vector< SubjectRef > eve::inventory::InventoryControl::gameplayInstances ( ) const
overridevirtual

Instances currently served, in publication order.

Gameplay instances.

实现了 eve::IGameplayInstanceCatalog.

在文件 InventoryControl.cpp 第 116 行定义.

引用了 instances().

◆ instances()

std::vector< SubjectRef > eve::inventory::InventoryControl::instances ( ) const

Published instance identities, in publication order.

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

被这些函数引用 gameplayInstances().

◆ observeGameplay()

Result< GameplayObservation > eve::inventory::InventoryControl::observeGameplay ( const GameplaySession &  session,
SubjectRef  instance 
) const
overridevirtual

◆ operator=()

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

◆ publish()

Result< void > eve::inventory::InventoryControl::publish ( SubjectRef  instance,
SubjectRef  owner,
Bag &  bag,
EquipmentSet *  equipment 
)

Publish one borrowed inventory instance under a stable identity.

参数
instanceStable identity of the instance, a canonical persistent id.
ownerStable identity of the player/actor controlling it.
bagBorrowed container observed and mutated by this adapter.
equipmentBorrowed equipment set, or null when the instance has none.
返回
Success, or Conflict when that instance is already published. @ownership The publication does not take ownership of bag or equipment.

在文件 InventoryControl.cpp 第 65 行定义.

引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::SubjectRef::isValid() , 以及 eve::Result< T >::success().

◆ submitGameplay()

◆ unpublish()

Result< void > eve::inventory::InventoryControl::unpublish ( SubjectRef  instance)

Drop one publication; NotFound when that instance is not published.

在文件 InventoryControl.cpp 第 81 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), found, eve::NotFound , 以及 eve::Result< T >::success().


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