Exposes one weapon through the shared gameplay command protocol. 更多...
#include <WeaponControl.h>
Public 成员函数 | |
| WeaponControl (SubjectRef instance, SubjectRef wielder, WeaponDefinition definition, resource::IResourceAccount &account, transaction::ITransactionParticipant &effect) | |
| Construct a control adapter for one copied definition and borrowed effect authorities. | |
| ~WeaponControl () override | |
| Unpublish the capability without destroying borrowed authorities. | |
| WeaponControl (const WeaponControl &)=delete | |
| WeaponControl & | operator= (const WeaponControl &)=delete |
| 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 one weapon through the shared gameplay command protocol.
The definition is copied at construction. The resource account and effect participant remain authoritative borrowed collaborators and must outlive this owner-thread-affine adapter. Firing is delegated to WeaponActionAdapter.
在文件 WeaponControl.h 第 30 行定义.
构造及析构函数说明
◆ WeaponControl() [1/2]
| eve::weapon::WeaponControl::WeaponControl | ( | SubjectRef | instance, |
| SubjectRef | wielder, | ||
| WeaponDefinition | definition, | ||
| resource::IResourceAccount & | account, | ||
| transaction::ITransactionParticipant & | effect | ||
| ) |
Construct a control adapter for one copied definition and borrowed effect authorities.
- 参数
-
instance Stable identity of this weapon-control instance. wielder Stable player-controllable subject identity. definition Owning weapon definition copied into the adapter. account Borrowed authoritative resource account. effect Borrowed authoritative weapon-effect transaction participant.
在文件 WeaponControl.cpp 第 47 行定义.
◆ ~WeaponControl()
|
override |
Unpublish the capability without destroying borrowed authorities.
在文件 WeaponControl.cpp 第 59 行定义.
◆ WeaponControl() [2/2]
|
delete |
成员函数说明
◆ advanceGameplay()
|
overridevirtual |
Advance one provider-owned instance using injected deterministic time.
Advance gameplay.
实现了 eve::IGameplayControlProvider.
在文件 WeaponControl.cpp 第 193 行定义.
引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), observeGameplay(), session , 以及 step.
◆ availableGameplayActions()
|
overridevirtual |
Discover currently legal player-semantic actions for one subject.
Available gameplay actions.
实现了 eve::IGameplayControlProvider.
在文件 WeaponControl.cpp 第 110 行定义.
引用了 eve::Diagnostic::error(), id, observeGameplay(), eve::PreconditionViolation, session , 以及 subject.
◆ gameplayDomain()
|
overridevirtualnoexcept |
Stable provider domain used for discovery and routing.
Gameplay domain.
实现了 eve::IGameplayControlProvider.
在文件 WeaponControl.cpp 第 64 行定义.
◆ gameplayEvents()
|
overridevirtual |
Return events strictly newer than an instance-local sequence cursor.
Gameplay events.
实现了 eve::IGameplayControlProvider.
在文件 WeaponControl.cpp 第 206 行定义.
引用了 eve::Applied, eve::NoOp, observeGameplay(), session , 以及 eve::Status::success().
◆ gameplayInstances()
|
overridevirtual |
Instances currently served, in publication order.
Gameplay instances.
实现了 eve::IGameplayInstanceCatalog.
在文件 WeaponControl.cpp 第 66 行定义.
◆ observeGameplay()
|
overridevirtual |
Observe one provider-owned gameplay instance without mutation.
Observe gameplay.
实现了 eve::IGameplayControlProvider.
在文件 WeaponControl.cpp 第 79 行定义.
引用了 eve::resource::IResourceAccount::canAfford(), cost, eve::weapon::WeaponDefinition::damage, eve::GameplayObservation::domain, eve::Diagnostic::error(), eve::Result< T >::failure(), id, eve::weapon::WeaponDefinition::id, eve::GameplayObservation::instance, eve::SubjectRef::isValid(), eve::NotFound, eve::PreconditionViolation, eve::weapon::WeaponDefinition::range, eve::weapon::WeaponActionAdapter::resourceCost(), eve::GameplayObservation::revision, session, eve::StaleHandle, eve::GameplayObservation::state, eve::Result< T >::success() , 以及 eve::GameplayObservation::tick.
被这些函数引用 advanceGameplay(), availableGameplayActions() , 以及 gameplayEvents().
◆ operator=()
|
delete |
◆ submitGameplay()
|
overridevirtual |
Validate authority and atomically submit one domain command.
Submit gameplay.
实现了 eve::IGameplayControlProvider.
在文件 WeaponControl.cpp 第 128 行定义.
引用了 eve::GameplayCommandReceipt::acceptedTick, eve::GameplayCommand::action, eve::Applied, eve::GameplayCommandReceipt::commandId, eve::Conflict, eve::GameplayCommandReceipt::details, eve::Diagnostic::error(), eve::GameplayCommandReceipt::executionId, eve::GameplayCommand::expectedRevision, eve::Result< T >::failure(), eve::weapon::WeaponActionAdapter::fire(), eve::weapon::AttackRequest::hasTarget, eve::GameplayCommand::id, eve::weapon::WeaponDefinition::id, eve::InvalidArgument, eve::NotFound, number, object, eve::GameplayCommand::observedTick, eve::GameplayCommand::parameters, pitch, eve::weapon::AttackRequest::pitch, eve::PreconditionViolation, eve::GameplayCommandReceipt::resultingRevision, eve::GameplayEvent::sequence, session, eve::weapon::AttackRequest::shooterId, eve::GameplayCommand::subject, eve::Status::success(), eve::Result< T >::success(), eve::weapon::AttackRequest::targetX, eve::weapon::AttackRequest::targetY, eve::weapon::AttackRequest::targetZ, eve::Unsupported, values, x, y, yaw, eve::weapon::AttackRequest::yaw , 以及 z.
该类的文档由以下文件生成:
- src/modules/weapon/WeaponControl.h
- src/modules/weapon/WeaponControl.cpp
Public 成员函数 继承自