Exposes the module's conversation runner through the shared gameplay protocol. 更多...
#include <DialogueControl.h>
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]
|
explicit |
Create an adapter for one borrowed conversation runner.
- 参数
-
flow Borrowed module facade that must outlive this adapter.
在文件 DialogueControl.cpp 第 44 行定义.
◆ ~DialogueControl()
|
override |
Unpublish without touching the borrowed runner.
在文件 DialogueControl.cpp 第 49 行定义.
◆ DialogueControl() [2/2]
|
delete |
成员函数说明
◆ advanceGameplay()
|
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()
|
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()
|
overridevirtualnoexcept |
Stable provider domain used for discovery and routing.
Gameplay domain.
实现了 eve::IGameplayControlProvider.
在文件 DialogueControl.cpp 第 87 行定义.
◆ gameplayEvents()
|
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()
|
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()
|
overridevirtual |
Observe one provider-owned gameplay instance without mutation.
Observe gameplay.
实现了 eve::IGameplayControlProvider.
在文件 DialogueControl.cpp 第 122 行定义.
引用了 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::dialogue::DialogueControl::publish | ( | SubjectRef | instance, |
| SubjectRef | owner | ||
| ) |
Publish the conversation runner under a stable instance identity.
- 参数
-
instance Stable identity of the instance, a canonical persistent id. owner Stable identity of the player/actor that controls it.
- 返回
- Success, or
Conflictwhen 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()
|
overridevirtual |
Validate authority and atomically submit one domain command.
Submit gameplay.
实现了 eve::IGameplayControlProvider.
在文件 DialogueControl.cpp 第 178 行定义.
引用了 eve::GameplayCommandReceipt::acceptedTick, eve::GameplayCommand::action, action, eve::dialogue::DialogueFlow::advanceChecked(), eve::Applied, eve::GameplayCommandReceipt::commandId, eve::Conflict, detail, eve::GameplayCommandReceipt::details, eve::GameplayCommandReceipt::executionId, eve::GameplayCommand::expectedRevision, eve::Result< T >::failure(), eve::LogicalId::format(), eve::dialogue::DialogueFlow::getNodeId(), eve::dialogue::DialogueFlow::getNodeKind(), eve::GameplayCommand::id, eve::InvalidArgument, eve::dialogue::DialogueFlow::isActive(), eve::NotFound, object, eve::GameplayCommand::observedTick, eve::GameplayCommand::parameters, eve::PreconditionViolation, eve::GameplayCommandReceipt::resultingRevision, eve::dialogue::DialogueFlow::select(), session, eve::dialogue::DialogueFlow::startChecked(), started, eve::GameplayCommand::subject, eve::Status::success(), eve::Result< T >::success(), text, eve::Unsupported , 以及 values.
◆ 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().
该类的文档由以下文件生成:
- src/modules/dialogue/DialogueControl.h
- src/modules/dialogue/DialogueControl.cpp
Public 成员函数 继承自