载入中...
搜索中...
未找到
eve::dialogue::DialogueControl类 参考final

Exposes the module's conversation runner through the shared gameplay protocol. 更多...

#include <DialogueControl.h>

类 eve::dialogue::DialogueControl 继承关系图:
eve::IGameplayControlProvider eve::IGameplayInstanceCatalog

Public 成员函数

 DialogueControl (DialogueFlow &flow)
 Create an adapter for one borrowed conversation runner.
 
 ~DialogueControl () override
 Unpublish without touching the borrowed runner.
 
 DialogueControl (const DialogueControl &)=delete
 
DialogueControl & operator= (const DialogueControl &)=delete
 
Result< void > publish (SubjectRef instance, SubjectRef owner)
 Publish the conversation runner under a stable instance identity.
 
Result< void > unpublish (SubjectRef instance)
 Drop the publication; NotFound when that instance is not published.
 
void clear ()
 Drop every publication.
 
int count () const
 Number of published instances (0 or 1).
 
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 conversation runner through the shared gameplay protocol.

A conversation that waits for a player choice is one of the few states an unattended agent cannot diagnose from the outside: the runner is authoritative and the game's HUD is only a projection of it. This adapter publishes that runner so an agent can observe the current node, speaker, text and route vocabulary, and then play the conversation with the module's own operations (startChecked/advanceChecked/select) instead of calling script internals.

DialogueFlow runs exactly one conversation at a time, so the domain publishes at most one instance: a second publish is refused with Conflict rather than handing two identities the same runner.

A conversation started through automation has no Squirrel call frame, so it starts with an empty binding table. Conditions that read bindings therefore resolve as absent, which is disclosed here and in the returned observation rather than guessed.

@ownership The flow is a borrowed authority owned by the module; the adapter keeps only the publication identity, its own revision and event ledger, and never owns conversation state. @thread Owner-simulation thread only, like every gameplay provider. @reentrancy submitGameplay invokes the module's own operations, which may synchronously run the game's configured command handlers; those must not re-enter this adapter.

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

构造及析构函数说明

◆ DialogueControl() [1/2]

eve::dialogue::DialogueControl::DialogueControl ( DialogueFlow &  flow)
explicit

Create an adapter for one borrowed conversation runner.

参数
flowBorrowed module facade that must outlive this adapter.

在文件 DialogueControl.cpp 第 44 行定义.

◆ ~DialogueControl()

eve::dialogue::DialogueControl::~DialogueControl ( )
override

Unpublish without touching the borrowed runner.

在文件 DialogueControl.cpp 第 49 行定义.

◆ DialogueControl() [2/2]

eve::dialogue::DialogueControl::DialogueControl ( const DialogueControl &  )
delete

成员函数说明

◆ advanceGameplay()

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

Advance one provider-owned instance using injected deterministic time.

Advance gameplay.

实现了 eve::IGameplayControlProvider.

在文件 DialogueControl.cpp 第 259 行定义.

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

◆ availableGameplayActions()

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

Discover currently legal player-semantic actions for one subject.

Available gameplay actions.

实现了 eve::IGameplayControlProvider.

在文件 DialogueControl.cpp 第 139 行定义.

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

◆ clear()

void eve::dialogue::DialogueControl::clear ( )

Drop every publication.

在文件 DialogueControl.cpp 第 77 行定义.

◆ count()

int eve::dialogue::DialogueControl::count ( ) const

Number of published instances (0 or 1).

在文件 DialogueControl.cpp 第 79 行定义.

◆ gameplayDomain()

std::string_view eve::dialogue::DialogueControl::gameplayDomain ( ) const
overridevirtualnoexcept

Stable provider domain used for discovery and routing.

Gameplay domain.

实现了 eve::IGameplayControlProvider.

在文件 DialogueControl.cpp 第 87 行定义.

◆ gameplayEvents()

Result< std::vector< GameplayEvent > > eve::dialogue::DialogueControl::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.

在文件 DialogueControl.cpp 第 273 行定义.

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

◆ gameplayInstances()

std::vector< SubjectRef > eve::dialogue::DialogueControl::gameplayInstances ( ) const
overridevirtual

Instances currently served, in publication order.

Gameplay instances.

实现了 eve::IGameplayInstanceCatalog.

在文件 DialogueControl.cpp 第 89 行定义.

引用了 instances().

◆ instances()

std::vector< SubjectRef > eve::dialogue::DialogueControl::instances ( ) const

Published instance identities, in publication order.

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

被这些函数引用 gameplayInstances().

◆ observeGameplay()

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

◆ operator=()

DialogueControl & eve::dialogue::DialogueControl::operator= ( const DialogueControl &  )
delete

◆ publish()

Result< void > eve::dialogue::DialogueControl::publish ( SubjectRef  instance,
SubjectRef  owner 
)

Publish the conversation runner under a stable instance identity.

参数
instanceStable identity of the instance, a canonical persistent id.
ownerStable identity of the player/actor that controls it.
返回
Success, or Conflict when the runner is already published.

在文件 DialogueControl.cpp 第 54 行定义.

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

◆ submitGameplay()

◆ unpublish()

Result< void > eve::dialogue::DialogueControl::unpublish ( SubjectRef  instance)

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

在文件 DialogueControl.cpp 第 69 行定义.

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


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