载入中...
搜索中...
未找到
ActionGameEventSink.cpp
浏览该文件的文档.
13ActionGameEventSink::~ActionGameEventSink() { cap::removeListener<IActionGameplayEventSink>(this); }
31 if (!log_) return Result<void>::failure(Diagnostic::error(DiagnosticCode::NotFound, "game event log is unavailable", "log"));
32 if (!resolver_) return Result<void>::failure(Diagnostic::error(DiagnosticCode::NotFound, "action subject resolver is unavailable", "resolver"));
43 return Result<void>::failure(Diagnostic::error(DiagnosticCode::NotFound, "gameplay event target index is unavailable", "targetIndex"));
50 return Result<void>::failure(Diagnostic::error(DiagnosticCode::NotFound, "gameplay event has no source or target subject", "subject"));
56 if (!schema) return Result<void>::failure(Diagnostic::error(DiagnosticCode::Failed, "built-in gameplay event schema is invalid", "schemaId"));
72std::optional<eve::game_event::EventSequence> ActionGameEventSink::lastSequence() const noexcept {
Persistent GameEventLog adapter for action events.
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
void setEnabled(bool enabled)
Opt this adapter into or out of gameplay-event dispatch.
Definition ActionGameEventSink.cpp:21
bool enabled() const
Return whether this exact adapter is registered.
Definition ActionGameEventSink.cpp:15
ActionGameEventSink(eve::game_event::GameEventLog &log, ActionSubjectResolver resolver)
Construct from borrowed event authority and an owning resolver callback.
Definition ActionGameEventSink.cpp:10
Result< void > emit(const ActionGameplayEventBinding &binding, const ActionNotifyContext &context) override
Emit one validated event or return a structured domain failure.
Definition ActionGameEventSink.cpp:29
std::optional< eve::game_event::EventSequence > lastSequence() const noexcept
Return the last successfully appended stream-local sequence.
Definition ActionGameEventSink.cpp:72
Deterministic in-memory stream of topic-neutral event envelopes.
Definition GameEvent.h:261
eve::Result< EventSequence > append(GameEvent envelope)
Appends a typed-metadata envelope and assigns stream-local order.
Definition GameEvent.cpp:255
std::function< Result< SubjectRef >(ecs::EntityHandle)> ActionSubjectResolver
Resolves a stable gameplay subject for a generation-qualified ECS handle.
Definition ActionGameEventSink.h:21
@ NotFound
@ Failed
@ Applied
detail::StrongUint64< detail::SchemaVersionTag > SchemaVersion
Persistent data-format version; not a runtime replacement generation.
Definition SchemaVersion.h:13
Definition Container.h:602
Owning validated event request authored on an action timeline.
Definition ActionGameplayEventBlock.h:15
Context linking a routed event to its action execution.
Definition ActionNotifyRegistry.h:34
std::string payload
Canonical serialized payload at the stream persistence boundary.
Definition GameEvent.h:207
SchemaVersion schemaVersion
Version of the payload schema, not a stream or runtime generation.
Definition GameEvent.h:201
SimulationTick tick
Deterministic simulation time at which the event was emitted.
Definition GameEvent.h:203