Exposes published card hands through the shared gameplay protocol. 更多...
#include <CardControl.h>
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]
|
explicit |
Create an unpublished adapter.
- 参数
-
module Borrowed card facade that must outlive this adapter.
在文件 CardControl.cpp 第 96 行定义.
◆ ~CardControl()
|
override |
Unpublish every hand without touching the borrowed authorities.
在文件 CardControl.cpp 第 101 行定义.
◆ CardControl() [2/2]
|
delete |
成员函数说明
◆ advanceGameplay()
|
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()
|
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()
|
overridevirtualnoexcept |
Stable provider domain used for discovery and routing.
Gameplay domain.
实现了 eve::IGameplayControlProvider.
在文件 CardControl.cpp 第 144 行定义.
◆ gameplayEvents()
|
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()
|
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()
|
overridevirtual |
Observe one provider-owned gameplay instance without mutation.
Observe gameplay.
实现了 eve::IGameplayControlProvider.
在文件 CardControl.cpp 第 202 行定义.
引用了 eve::GameplayObservation::domain, id, eve::GameplayObservation::instance, eve::NotFound, eve::PreconditionViolation, eve::GameplayObservation::revision, session, eve::GameplayObservation::state, eve::Result< T >::success() , 以及 eve::GameplayObservation::tick.
被这些函数引用 advanceGameplay(), availableGameplayActions() , 以及 gameplayEvents().
◆ operator=()
|
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.
- 参数
-
instance Stable identity of the instance, a canonical persistent id. owner Stable identity of the player/actor controlling it. hand Borrowed hand observed and mutated by this adapter. account Borrowed payment account, or null when the game has none.
- 返回
- Success, or
Conflictwhen 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()
|
overridevirtual |
Validate authority and atomically submit one domain command.
Submit gameplay.
实现了 eve::IGameplayControlProvider.
在文件 CardControl.cpp 第 249 行定义.
引用了 eve::GameplayCommandReceipt::acceptedTick, account, eve::GameplayCommand::action, action, eve::Applied, eve::GameplayCommandReceipt::commandId, eve::Conflict, detail, eve::GameplayCommandReceipt::details, eve::card::Card::drawCard(), eve::GameplayCommandReceipt::executionId, eve::GameplayCommand::expectedRevision, eve::Failed, eve::Result< T >::failure(), eve::LogicalId::format(), eve::GameplayCommand::id, eve::InvalidArgument, eve::NotFound, number, object, eve::GameplayCommand::observedTick, eve::GameplayCommand::parameters, eve::card::Card::play(), eve::PlayerEquivalent, eve::PreconditionViolation, eve::GameplayCommandReceipt::resultingRevision, eve::GameplayEvent::sequence, session, eve::card::Card::setCardAttribute(), eve::GameplayCommand::subject, eve::Status::success(), eve::Result< T >::success(), text, eve::Unsupported, value, eve::ui::WidgetDesc::value , 以及 values.
◆ 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().
该类的文档由以下文件生成:
- src/modules/card/CardControl.h
- src/modules/card/CardControl.cpp
Public 成员函数 继承自