载入中...
搜索中...
未找到
eve::card::CardControl类 参考final

Exposes published card hands through the shared gameplay protocol. 更多...

#include <CardControl.h>

类 eve::card::CardControl 继承关系图:
eve::IGameplayControlProvider eve::IGameplayInstanceCatalog

Public 成员函数

 CardControl (Card &module)
 Create an unpublished adapter.
 
 ~CardControl () override
 Unpublish every hand without touching the borrowed authorities.
 
 CardControl (const CardControl &)=delete
 
CardControl & operator= (const CardControl &)=delete
 
Result< void > publish (SubjectRef instance, SubjectRef owner, Hand &hand, eve::resource::IResourceAccount *account)
 Publish one borrowed hand 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 card hands through the shared gameplay protocol.

The card module owns definitions, ECS-backed cards, hands, zones, decks and the transactional play path, but none of it was reachable from eve_gameplay: an unattended agent could only poke script internals. The vocabulary here is the module's own — card:draw calls the module's deck-to-hand draw, card:play goes through Card::play (condition, container and payment transaction), and card:set-attribute is exposed as a cheat for the test-driver and developer-cheat profiles because it rewrites canonical combat attributes.

Playing a card needs the game's authoritative money account, which the adapter cannot invent: a publication may bind a borrowed IResourceAccount. Without one, card:play is neither advertised nor accepted (Unsupported), and the observation reports "payment":"unbound" so the gap is visible rather than silently missing.

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

@ownership Published hands and accounts are borrowed authorities that must outlive their publication; the adapter keeps only identity, revision and its own event ledger. @thread Owner-simulation thread only, like every gameplay provider. @reentrancy No method invokes callbacks; submitGameplay calls the module's own synchronous operations and appends to its event ledger.

在文件 CardControl.h 第 44 行定义.

构造及析构函数说明

◆ CardControl() [1/2]

eve::card::CardControl::CardControl ( Card &  module)
explicit

Create an unpublished adapter.

参数
moduleBorrowed card facade that must outlive this adapter.

在文件 CardControl.cpp 第 96 行定义.

◆ ~CardControl()

eve::card::CardControl::~CardControl ( )
override

Unpublish every hand without touching the borrowed authorities.

在文件 CardControl.cpp 第 101 行定义.

◆ CardControl() [2/2]

eve::card::CardControl::CardControl ( const CardControl &  )
delete

成员函数说明

◆ advanceGameplay()

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

Advance one provider-owned instance using injected deterministic time.

Advance gameplay.

实现了 eve::IGameplayControlProvider.

在文件 CardControl.cpp 第 346 行定义.

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

◆ availableGameplayActions()

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

Discover currently legal player-semantic actions for one subject.

Available gameplay actions.

实现了 eve::IGameplayControlProvider.

在文件 CardControl.cpp 第 219 行定义.

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

◆ clear()

void eve::card::CardControl::clear ( )

Drop every publication.

在文件 CardControl.cpp 第 133 行定义.

◆ count()

int eve::card::CardControl::count ( ) const

Number of published instances.

在文件 CardControl.cpp 第 135 行定义.

◆ gameplayDomain()

std::string_view eve::card::CardControl::gameplayDomain ( ) const
overridevirtualnoexcept

Stable provider domain used for discovery and routing.

Gameplay domain.

实现了 eve::IGameplayControlProvider.

在文件 CardControl.cpp 第 144 行定义.

◆ gameplayEvents()

Result< std::vector< GameplayEvent > > eve::card::CardControl::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.

在文件 CardControl.cpp 第 361 行定义.

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

◆ gameplayInstances()

std::vector< SubjectRef > eve::card::CardControl::gameplayInstances ( ) const
overridevirtual

Instances currently served, in publication order.

Gameplay instances.

实现了 eve::IGameplayInstanceCatalog.

在文件 CardControl.cpp 第 146 行定义.

引用了 instances().

◆ instances()

std::vector< SubjectRef > eve::card::CardControl::instances ( ) const

Published instance identities, in publication order.

在文件 CardControl.cpp 第 137 行定义.

被这些函数引用 gameplayInstances().

◆ observeGameplay()

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

◆ operator=()

CardControl & eve::card::CardControl::operator= ( const CardControl &  )
delete

◆ publish()

Result< void > eve::card::CardControl::publish ( SubjectRef  instance,
SubjectRef  owner,
Hand &  hand,
eve::resource::IResourceAccount *  account 
)

Publish one borrowed hand under a stable instance identity.

参数
instanceStable identity of the instance, a canonical persistent id.
ownerStable identity of the player/actor controlling it.
handBorrowed hand observed and mutated by this adapter.
accountBorrowed payment account, or null when the game has none.
返回
Success, or Conflict when that instance is already published.

在文件 CardControl.cpp 第 106 行定义.

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

◆ submitGameplay()

◆ unpublish()

Result< void > eve::card::CardControl::unpublish ( SubjectRef  instance)

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

在文件 CardControl.cpp 第 123 行定义.

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


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