载入中...
搜索中...
未找到
WeaponControl.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
12#include "weapon/WeaponTypes.h"
13
14namespace eve::resource {
15class IResourceAccount;
16}
17namespace eve::transaction {
18class ITransactionParticipant;
19}
20
21namespace eve::weapon {
22
31public:
44 ~WeaponControl() override;
45
46 WeaponControl(const WeaponControl&) = delete;
48
51 [[nodiscard]] std::string_view gameplayDomain() const noexcept override;
54 [[nodiscard]] std::vector<SubjectRef> gameplayInstances() const override;
57 [[nodiscard]] Result<GameplayObservation> observeGameplay(const GameplaySession& session,
58 SubjectRef instance) const override;
61 [[nodiscard]] Result<std::vector<GameplayActionDescriptor>> availableGameplayActions(
62 const GameplaySession& session, SubjectRef instance, SubjectRef subject) const override;
65 [[nodiscard]] Result<GameplayCommandReceipt> submitGameplay(const GameplaySession& session,
66 SubjectRef instance,
67 const GameplayCommand& command) override;
70 [[nodiscard]] Result<GameplayObservation> advanceGameplay(const GameplaySession& session,
71 SubjectRef instance,
72 const SimulationStep& step) override;
75 [[nodiscard]] Result<std::vector<GameplayEvent>> gameplayEvents(const GameplaySession& session,
76 SubjectRef instance,
77 std::uint64_t afterSequence) const override;
78
79private:
80 [[nodiscard]] bool controls(const GameplaySession& session) const;
81
82 SubjectRef instance_;
83 SubjectRef wielder_;
84 WeaponDefinition definition_;
85 resource::IResourceAccount* account_ = nullptr;
86 transaction::ITransactionParticipant* effect_ = nullptr;
87 SimulationTick tick_ = SimulationTick::zero();
88 std::uint64_t revision_ = 1;
89 std::uint64_t nextEventSequence_ = 1;
90 std::vector<GameplayEvent> events_;
91};
92
93} // namespace eve::weapon
int subject
Definition AnimSmr.cpp:163
eve::resource::IResourceAccount * account
#define EVENGINE_API_WORLD
Definition Export.h:109
Host-neutral player-equivalent command and observation protocol.
Optional companion surface for gameplay providers that can enumerate instances.
std::unique_ptr< ParticleEffect > effect
std::string resource
LogicalId definition
std::optional< InteractionSession > session
Definition Tactics.cpp:39
float step
Definition TreeMesh.cpp:314
Multi-provider gameplay boundary consumed by input, scripts and automation.
Optional read-only discovery surface implemented beside a gameplay provider.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Strong, domain-neutral reference to a runtime subject.
Definition SubjectRef.h:26
Provider-neutral resource account contract.
Synchronous participant contract for one coordinator transaction.
Exposes one weapon through the shared gameplay command protocol.
WeaponControl(const WeaponControl &)=delete
WeaponControl & operator=(const WeaponControl &)=delete
载具模块入口(eve.Vehicle):定义注册 / 实体工厂 / RTS 命令 / 帧调度。 设计文档:docs/dev/通用载具系统设计.md
One discoverable domain action and its owning schema projection.
Owning evidence that a gameplay authority accepted one command.
One player-semantic command submitted to a domain authority.
Owning event projection safe across frames and process boundaries.
Immutable owning observation of one authoritative gameplay instance.
Owning authorization context shared by player, script and automation adapters.
One deterministic fixed-step emitted by SimulationClock.
Definition Time.h:158
武器模板(registerWeaponsFromJson 注册,进程级注册表)。