载入中...
搜索中...
未找到
ProductControl.cpp
浏览该文件的文档.
110 Diagnostic::error(DiagnosticCode::StaleHandle, "RPG product control participants are invalid", "instance"));
153 Diagnostic::error(DiagnosticCode::NotFound, "RPG product gameplay instance was not found", "instance"));
156 DiagnosticCode::PreconditionViolation, "session does not control this RPG product state", "instance"));
216 Diagnostic::error(DiagnosticCode::NotFound, "RPG product gameplay instance was not found", "instance"));
219 Diagnostic::error(DiagnosticCode::PreconditionViolation, "session does not control this RPG product state",
223 Diagnostic::error(DiagnosticCode::InvalidArgument, "command id must not be empty", "command.id"));
228 Diagnostic::error(DiagnosticCode::Conflict, "RPG product command was based on a stale observation",
292 Diagnostic::error(DiagnosticCode::Unsupported, "unsupported RPG product action", "command.action"));
318 Diagnostic::error(DiagnosticCode::Conflict, "RPG product simulation tick must increase", "step.tick"));
全局游戏状态:开关(bool)、变量(数字)、独立变量(按作用域)。
Player-equivalent control adapter for persistent RPG product loops.
Atomic orchestration for claiming data-driven quest rewards.
Atomic RPG currency and inventory purchase/sale orchestration.
目标追踪器运行时实例(玩家日志 / 成就 / 教程可各建一份)。
Atomic settlement of persistent world loot interactions.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static std::optional< LogicalId > parse(std::string_view text)
Parses a scoped logical name.
Definition Identity.cpp:36
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.h:81
bool isValid() const noexcept
Return whether this reference is valid and non-nil.
Definition SubjectRef.h:38
static Result< Value > fromJson(std::string_view json)
Parse one strict JSON value into an owning Value.
Definition Value.cpp:57
eve::Result< std::string > snapshotJson() const
Serialize this state as the canonical versioned RPG game-state JSON document.
Definition GameState.cpp:119
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.
Definition ProductControl.cpp:326
Result< GameplayObservation > observeGameplay(const GameplaySession &session, SubjectRef instance) const override
Observe one provider-owned gameplay instance without mutation.
Definition ProductControl.cpp:149
Result< GameplayObservation > advanceGameplay(const GameplaySession &session, SubjectRef instance, const SimulationStep &step) override
Advance one provider-owned instance using injected deterministic time.
Definition ProductControl.cpp:313
Result< std::vector< GameplayActionDescriptor > > availableGameplayActions(const GameplaySession &session, SubjectRef instance, SubjectRef subject) const override
Discover currently legal player-semantic actions for one subject.
Definition ProductControl.cpp:170
~ProductControl() override
Unpublish the capability without destroying borrowed authorities.
Definition ProductControl.cpp:87
std::string_view gameplayDomain() const noexcept override
Stable provider domain used for discovery and routing.
Definition ProductControl.cpp:92
std::vector< SubjectRef > gameplayInstances() const override
Instances currently served, in publication order.
Definition ProductControl.cpp:94
ProductControl(SubjectRef instance, GameState &gameState, Tracker &tracker, inventory::Bag &bag)
Construct over borrowed product-loop authorities and a stable instance identity.
Definition ProductControl.cpp:80
Result< GameplayCommandReceipt > submitGameplay(const GameplaySession &session, SubjectRef instance, const GameplayCommand &command) override
Validate authority and atomically submit one domain command.
Definition ProductControl.cpp:211
static eve::Result< int > claim(Tracker &tracker, GameState &gameState, inventory::Bag &bag, const std::string &questId)
Validate and atomically claim every reward declared by one ready quest.
Definition QuestReward.cpp:25
static eve::Result< int > sellOffer(GameState &gameState, inventory::Bag &bag, const std::string ¤cyId, const std::string &offerId, int quantity)
Sell a quantity using the authoritative price and item in ShopCatalogue.
Definition ShopTransaction.cpp:64
static eve::Result< int > buyOffer(GameState &gameState, inventory::Bag &bag, const std::string ¤cyId, const std::string &offerId, int quantity)
Buy a quantity using the authoritative price and item in ShopCatalogue.
Definition ShopTransaction.cpp:53
eve::Result< std::string > snapshotJson() const
Serialize persistent quest progress as deterministic versioned JSON.
Definition Tracker.cpp:44
static eve::Result< int > collectLoot(GameState &gameState, Tracker &tracker, inventory::Bag &bag, const WorldLootRequest &request)
Atomically grant loot, notify quest progress, and consume one world object.
Definition WorldInteraction.cpp:37
std::variant< std::monostate, std::int64_t, double, std::string, bool > Value
Definition Database.h:26
@ InvalidArgument
@ NotFound
@ PreconditionViolation
@ Unsupported
@ StaleHandle
@ Conflict
@ NoOp
@ Applied
@ PlayerEquivalent
Owning evidence that a gameplay authority accepted one command.
Definition GameplayControl.h:62
std::uint64_t resultingRevision
Definition GameplayControl.h:66
One player-semantic command submitted to a domain authority.
Definition GameplayControl.h:52
Owning event projection safe across frames and process boundaries.
Definition GameplayControl.h:71
Immutable owning observation of one authoritative gameplay instance.
Definition GameplayControl.h:43
Owning authorization context shared by player, script and automation adapters.
Definition GameplayControl.h:30
Complete data needed to settle one persistent loot object.
Definition WorldInteraction.h:24