载入中...
搜索中...
未找到
ProductControl.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
12
13namespace eve::inventory {
14class Bag;
15}
16
17namespace eve::rpg {
18
19class GameState;
20class Tracker;
21
30public:
32 ProductControl(SubjectRef instance, GameState& gameState, Tracker& tracker,
33 inventory::Bag& bag);
35 ~ProductControl() override;
36
39
42 [[nodiscard]] std::string_view gameplayDomain() const noexcept override;
45 [[nodiscard]] std::vector<SubjectRef> gameplayInstances() const override;
48 [[nodiscard]] Result<GameplayObservation> observeGameplay(const GameplaySession& session,
49 SubjectRef instance) const override;
52 [[nodiscard]] Result<std::vector<GameplayActionDescriptor>> availableGameplayActions(
53 const GameplaySession& session, SubjectRef instance, SubjectRef subject) const override;
56 [[nodiscard]] Result<GameplayCommandReceipt> submitGameplay(const GameplaySession& session,
57 SubjectRef instance,
58 const GameplayCommand& command) override;
61 [[nodiscard]] Result<GameplayObservation> advanceGameplay(const GameplaySession& session,
62 SubjectRef instance,
63 const SimulationStep& step) override;
66 [[nodiscard]] Result<std::vector<GameplayEvent>> gameplayEvents(const GameplaySession& session,
67 SubjectRef instance,
68 std::uint64_t afterSequence) const override;
69
70private:
71 [[nodiscard]] bool controls(const GameplaySession& session) const;
72 [[nodiscard]] Result<Value> stateProjection() const;
73 [[nodiscard]] Result<std::uint64_t> refreshRevision() const;
74 void publishEvent(std::string type, const GameplayCommand& command, Value payload);
75
76 SubjectRef instance_;
77 GameState* gameState_ = nullptr;
78 Tracker* tracker_ = nullptr;
79 inventory::Bag* bag_ = nullptr;
80 SimulationTick tick_ = SimulationTick::zero();
81 mutable std::uint64_t revision_ = 0;
82 mutable std::string stateFingerprint_;
83 std::uint64_t nextEventSequence_ = 1;
84 std::vector<GameplayEvent> events_;
85};
86
87} // namespace eve::rpg
Value::Object payload
int subject
Definition AnimSmr.cpp:163
#define EVENGINE_API_PLATFORM
Definition Export.h:107
Host-neutral player-equivalent command and observation protocol.
Optional companion surface for gameplay providers that can enumerate instances.
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
格子型物品容器(脚本可直接操作)。
Definition Bag.h:21
EVENGINE_API_FOUNDATION public API.
Definition Json.h:38
一份游戏状态(开关/变量/独立变量)。
Definition GameState.h:25
Host-neutral adapter joining shop, quest-reward and world-loot transactions.
ProductControl & operator=(const ProductControl &)=delete
ProductControl(const ProductControl &)=delete
一份任务进度 + 本实例事件队列。
Definition Tracker.h:26
运行时容器:固定格数的背包 / 箱子 / 商店栏等。 行为由 InventorySystem 提供;本类暴露便于脚本绑定的薄封装方法。
RPG 模块的基础实体:把属性 / 状态 / 技能三张表挂到一个 ECS 实体上。
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