Explicit stable-identity adapter over one caller-owned RPG battle. 更多...
#include <BattleControl.h>
Public 成员函数 | |
| BattleControl (Battle &battle, SubjectRef instance) | |
| Construct an adapter over a borrowed battle and stable instance identity. | |
| ~BattleControl () override | |
| Unpublish the capability without destroying the borrowed battle. | |
| BattleControl (const BattleControl &)=delete | |
| BattleControl & | operator= (const BattleControl &)=delete |
| Result< void > | bindParticipant (SubjectRef subject, RPGActor *actor) |
| Bind a stable subject to an existing battle participant. | |
| 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" |
详细描述
Explicit stable-identity adapter over one caller-owned RPG battle.
Battle remains the only mutable combat authority. The caller owns this adapter and must destroy it before the borrowed Battle or any bound actor. Binding is explicit because legacy RPGActor instances do not themselves own persistent IDs. Registration and calls are confined to the battle's simulation thread.
在文件 BattleControl.h 第 28 行定义.
构造及析构函数说明
◆ BattleControl() [1/2]
| eve::rpg::BattleControl::BattleControl | ( | Battle & | battle, |
| SubjectRef | instance | ||
| ) |
Construct an adapter over a borrowed battle and stable instance identity.
在文件 BattleControl.cpp 第 31 行定义.
◆ ~BattleControl()
|
override |
Unpublish the capability without destroying the borrowed battle.
在文件 BattleControl.cpp 第 37 行定义.
◆ BattleControl() [2/2]
|
delete |
成员函数说明
◆ advanceGameplay()
|
overridevirtual |
Advance one provider-owned instance using injected deterministic time.
Advance gameplay.
实现了 eve::IGameplayControlProvider.
在文件 BattleControl.cpp 第 214 行定义.
引用了 eve::rpg::Battle::autoEnemyActions(), eve::Conflict, eve::Diagnostic::error(), eve::rpg::Battle::executeNextAction(), eve::Result< T >::failure(), eve::SubjectRef::format(), found, eve::rpg::Battle::getEventAction(), eve::rpg::Battle::getEventAmount(), eve::rpg::Battle::getEventCaster(), eve::rpg::Battle::getEventCount(), eve::rpg::Battle::getEventCrit(), eve::rpg::Battle::getEventSkillId(), eve::rpg::Battle::getEventTarget(), index, eve::rpg::Battle::isFinished(), eve::NotFound, observeGameplay(), eve::rpg::Battle::pollEvents(), eve::GameplayEvent::sequence, session, eve::rpg::Battle::startRound() , 以及 step.
◆ availableGameplayActions()
|
overridevirtual |
Discover currently legal player-semantic actions for one subject.
Available gameplay actions.
实现了 eve::IGameplayControlProvider.
在文件 BattleControl.cpp 第 131 行定义.
引用了 eve::Diagnostic::error(), eve::rpg::Battle::isActorAlive(), eve::rpg::Battle::isFinished(), eve::NotFound, eve::PreconditionViolation, session , 以及 subject.
◆ bindParticipant()
| Result< void > eve::rpg::BattleControl::bindParticipant | ( | SubjectRef | subject, |
| RPGActor * | actor | ||
| ) |
Bind a stable subject to an existing battle participant.
- 返回
- Applied or validation failure.
在文件 BattleControl.cpp 第 42 行定义.
引用了 eve::Applied, eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::rpg::Battle::getActor(), eve::rpg::Battle::getActorCount(), index, eve::InvalidArgument, eve::SubjectRef::isValid(), eve::NotFound, subject, eve::Status::success() , 以及 eve::Result< T >::success().
◆ gameplayDomain()
|
overridevirtualnoexcept |
Stable provider domain used for discovery and routing.
Gameplay domain.
实现了 eve::IGameplayControlProvider.
在文件 BattleControl.cpp 第 64 行定义.
◆ gameplayEvents()
|
overridevirtual |
Return events strictly newer than an instance-local sequence cursor.
Gameplay events.
实现了 eve::IGameplayControlProvider.
在文件 BattleControl.cpp 第 254 行定义.
引用了 eve::Applied, eve::NoOp, observeGameplay(), session , 以及 eve::Status::success().
◆ gameplayInstances()
|
overridevirtual |
Instances currently served, in publication order.
Gameplay instances.
实现了 eve::IGameplayInstanceCatalog.
在文件 BattleControl.cpp 第 66 行定义.
◆ observeGameplay()
|
overridevirtual |
Observe one provider-owned gameplay instance without mutation.
Observe gameplay.
实现了 eve::IGameplayControlProvider.
在文件 BattleControl.cpp 第 90 行定义.
引用了 eve::GameplayObservation::domain, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::rpg::Battle::getActor(), eve::rpg::Battle::getActorCount(), eve::rpg::RPGActor::getCurrent(), eve::rpg::RPGActor::getMax(), eve::rpg::Battle::getSide(), eve::rpg::Battle::getTurn(), index, eve::GameplayObservation::instance, eve::rpg::Battle::isActorAlive(), eve::rpg::Battle::isDefeat(), eve::rpg::Battle::isFinished(), eve::SubjectRef::isValid(), eve::rpg::Battle::isVictory(), eve::NotFound, eve::PlayerEquivalent, eve::PreconditionViolation, eve::GameplayObservation::revision, session, eve::GameplayObservation::state, subject, eve::Result< T >::success() , 以及 eve::GameplayObservation::tick.
被这些函数引用 advanceGameplay() , 以及 gameplayEvents().
◆ operator=()
|
delete |
◆ submitGameplay()
|
overridevirtual |
Validate authority and atomically submit one domain command.
Submit gameplay.
实现了 eve::IGameplayControlProvider.
在文件 BattleControl.cpp 第 154 行定义.
引用了 eve::GameplayCommandReceipt::acceptedTick, eve::GameplayCommand::action, eve::Applied, eve::GameplayEvent::causationCommandId, eve::GameplayCommandReceipt::commandId, eve::Conflict, eve::GameplayEvent::correlationId, eve::GameplayCommandReceipt::details, eve::Diagnostic::error(), eve::GameplayCommandReceipt::executionId, eve::GameplayCommand::expectedRevision, eve::Result< T >::failure(), eve::LogicalId::format(), eve::SubjectRef::fromPersistentId(), eve::rpg::Battle::getTurn(), eve::GameplayCommand::id, eve::InvalidArgument, eve::NotFound, eve::GameplayCommand::observedTick, eve::GameplayCommand::parameters, eve::detail::Id128< Tag >::parse(), eve::GameplayEvent::payload, eve::PreconditionViolation, queued, eve::GameplayCommandReceipt::resultingRevision, eve::GameplayEvent::sequence, session, eve::rpg::Battle::setActionChecked(), eve::GameplayCommand::subject, eve::GameplayEvent::subject, eve::Status::success(), eve::Result< T >::success(), target, targetId, eve::GameplayEvent::tick, eve::GameplayEvent::type , 以及 eve::Unsupported.
该类的文档由以下文件生成:
- src/modules/rpg/BattleControl.h
- src/modules/rpg/BattleControl.cpp
Public 成员函数 继承自