载入中...
搜索中...
未找到
eve::economy::EconomyControl类 参考final

Exposes published player resource ledgers through the shared gameplay protocol. 更多...

#include <EconomyControl.h>

类 eve::economy::EconomyControl 继承关系图:
eve::IGameplayControlProvider eve::IGameplayInstanceCatalog

Public 成员函数

 EconomyControl ()
 Create an unpublished adapter and register it as the economy domain.
 
 ~EconomyControl () override
 Unpublish every instance.
 
 EconomyControl (const EconomyControl &)=delete
 
EconomyControl & operator= (const EconomyControl &)=delete
 
Result< void > publish (SubjectRef instance, SubjectRef owner, int player)
 Publish one player ledger under a stable instance identity.
 
Result< void > unpublish (SubjectRef instance)
 Drop one publication; NotFound when that instance is not published.
 
void clear ()
 Drop every publication.
 
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 published player resource ledgers through the shared gameplay protocol.

The economy module already owned the authoritative ledger (EconomySystem), but nothing bridged it to the gameplay protocol, so an unattended agent had to call eve_eval on module internals to read or change a balance. The action vocabulary here is the module's own: economy:debit is an ordinary spend, and economy:credit is a grant, refused for GameplayAccess::PlayerEquivalent and accepted only for the test-driver and developer-cheat profiles.

Gathering stays with the game: GatherNode/Collector drive extraction over simulated ticks, and re-exposing a cheaper "harvest now" shortcut here would be a second write path for the same fact.

One adapter serves every published instance (the shared router requires exactly one provider per domain), so several players can be observed at once.

@ownership The adapter stores only the integer player id, its own revision and event ledger, and the borrowed publication identity; the ledger itself stays owned by EconomySystem. @thread Owner-simulation thread only, like every gameplay provider. @reentrancy No method invokes callbacks; submitGameplay credits/debits the module ledger directly and appends to its own event ledger.

在文件 EconomyControl.h 第 37 行定义.

构造及析构函数说明

◆ EconomyControl() [1/2]

eve::economy::EconomyControl::EconomyControl ( )

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

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

◆ ~EconomyControl()

eve::economy::EconomyControl::~EconomyControl ( )
override

Unpublish every instance.

在文件 EconomyControl.cpp 第 70 行定义.

◆ EconomyControl() [2/2]

eve::economy::EconomyControl::EconomyControl ( const EconomyControl &  )
delete

成员函数说明

◆ advanceGameplay()

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

Advance one provider-owned instance using injected deterministic time.

Advance gameplay.

实现了 eve::IGameplayControlProvider.

在文件 EconomyControl.cpp 第 329 行定义.

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

◆ availableGameplayActions()

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

Discover currently legal player-semantic actions for one subject.

Available gameplay actions.

实现了 eve::IGameplayControlProvider.

在文件 EconomyControl.cpp 第 198 行定义.

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

◆ clear()

void eve::economy::EconomyControl::clear ( )

Drop every publication.

在文件 EconomyControl.cpp 第 100 行定义.

◆ count()

int eve::economy::EconomyControl::count ( ) const

Number of published instances.

在文件 EconomyControl.cpp 第 102 行定义.

◆ gameplayDomain()

std::string_view eve::economy::EconomyControl::gameplayDomain ( ) const
overridevirtualnoexcept

Stable provider domain used for discovery and routing.

Gameplay domain.

实现了 eve::IGameplayControlProvider.

在文件 EconomyControl.cpp 第 111 行定义.

◆ gameplayEvents()

Result< std::vector< GameplayEvent > > eve::economy::EconomyControl::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.

在文件 EconomyControl.cpp 第 344 行定义.

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

◆ gameplayInstances()

std::vector< SubjectRef > eve::economy::EconomyControl::gameplayInstances ( ) const
overridevirtual

Instances currently served, in publication order.

Gameplay instances.

实现了 eve::IGameplayInstanceCatalog.

在文件 EconomyControl.cpp 第 113 行定义.

引用了 instances().

◆ instances()

std::vector< SubjectRef > eve::economy::EconomyControl::instances ( ) const

Published instance identities, in publication order.

在文件 EconomyControl.cpp 第 104 行定义.

被这些函数引用 gameplayInstances().

◆ observeGameplay()

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

◆ operator=()

EconomyControl & eve::economy::EconomyControl::operator= ( const EconomyControl &  )
delete

◆ publish()

Result< void > eve::economy::EconomyControl::publish ( SubjectRef  instance,
SubjectRef  owner,
int  player 
)

Publish one player ledger under a stable instance identity.

参数
instanceStable identity of the instance, a canonical persistent id.
ownerStable identity of the player/actor controlling it.
playerModule-level player id whose ledger this instance observes.
返回
Success, or Conflict when that instance is already published.

在文件 EconomyControl.cpp 第 75 行定义.

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

◆ submitGameplay()

Result< GameplayCommandReceipt > eve::economy::EconomyControl::submitGameplay ( const GameplaySession &  session,
SubjectRef  instance,
const GameplayCommand &  command 
)
overridevirtual

◆ unpublish()

Result< void > eve::economy::EconomyControl::unpublish ( SubjectRef  instance)

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

在文件 EconomyControl.cpp 第 90 行定义.

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


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