载入中...
搜索中...
未找到
ClimbingServices.cpp
浏览该文件的文档.
34 ClimbingRuntime& runtime, physics::World3D& world, const ClimbingPose& pose, ClimbingIntent& intent,
38 return eve::Result<ClimbingServiceStart>::failure(eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument,
43 eve::DiagnosticCode::NotFound, "climbing.input.no_match", "intent.commands", {}, "climbing.services"));
61 eve::DiagnosticCode::Unsupported, "required climbing condition provider is absent", "conditions", {},
63 auto decision = conditions->evaluate(subject, prepared.value().action.requiredConditionTags, tick);
67 eve::DiagnosticCode::PreconditionViolation, "climbing action conditions were denied", "conditions", {},
80 eve::Diagnostic::error(eve::DiagnosticCode::Unsupported, "required climbing stamina provider is absent",
95 eve::DiagnosticCode::InvariantViolation, "stamina provider returned a zero reservation", "stamina",
102 auto consumed = ClimbingInputSystem::consume(intent, command, tick, prepared.value().executionId);
108 eve::Diagnostic::error(eve::DiagnosticCode::Conflict, "eligible climbing input changed before commit",
118 return eve::Result<ClimbingServiceStart>::success({std::move(committed).takeValue(), staminaState},
126 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "service subject must be non-zero", "subject",
138EVENGINE_API_DOMAINS eve::Result<ClimbingOptionalServiceState> applyClimbingPose(ClimbingServiceSubject subject,
142 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "service subject must be non-zero", "subject",
169 explicit ScriptClimbingEventSink(eve::ScriptProviderHandle handle) : handle_(std::move(handle)) {}
174 eve::Result<void> publish(ClimbingServiceSubject subject, std::span<const ClimbingEvent> events) override {
176 eve::ScriptArg::fromTable({{"subject", eve::Value::integer(static_cast<std::int64_t>(subject.value()))},
攀爬事件 ↔ eve::Value 的**唯一**映射。
std::vector< std::unique_ptr< ScriptClimbingEventSink > > live
Definition ClimbingServices.cpp:187
std::vector< std::unique_ptr< ScriptClimbingEventSink > > retired
Definition ClimbingServices.cpp:188
Consumer-owned contracts for optional stamina, event, and pose integrations.
Persistent, thread-safe record of engine crash and problem events.
Owning, renderer-independent dynamic values.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
void ignore(std::string_view reason={}) const noexcept
Explicitly discard this result after documenting the reason.
Definition Result.h:571
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
Result< void > removeCapability(std::string_view capability)
Withdraw a declared seam when its owning module goes away.
Definition ScriptProvider.cpp:416
static ScriptProviderRegistry & instance()
Process-lifetime registry; clearAll is the only reset.
Definition ScriptProvider.cpp:318
void declareCapability(std::string capability, ScriptCapabilityBinder binder, ScriptCapabilityUnbinder unbinder)
Declare that one native capability may be served by a script provider.
Definition ScriptProvider.cpp:404
Result< void > call(const ScriptProviderHandle &handle, std::string_view method) const
Call method() on a published provider.
Definition ScriptProvider.cpp:518
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.cpp:19
static Value integer(std::int64_t value)
Compatibility factory for an Int64 value.
Definition Value.h:115
static ClimbingCoyoteState coyoteWindowState(eve::SimulationTick currentTick, eve::SimulationTick lastGroundedTick, std::uint64_t coyoteTicks) noexcept
Evaluate a grounded grace window without reading wall clock.
Definition ClimbingInput.cpp:101
static eve::Result< std::optional< BufferedClimbingCommand > > consume(ClimbingIntent &intent, ClimbingCommand command, eve::SimulationTick currentTick, ClimbingExecutionId executionId)
Atomically mark the oldest eligible command consumed by one committed execution.
Definition ClimbingInput.cpp:71
static std::optional< BufferedClimbingCommand > peek(const ClimbingIntent &intent, ClimbingCommand command, eve::SimulationTick currentTick) noexcept
Observe the oldest eligible command without consuming or pruning intent.
Definition ClimbingInput.cpp:92
Owner-thread climbing planner and executor for one character.
Definition Climbing.h:659
static eve::Result< ClimbingServiceStart > tryStart(ClimbingRuntime &runtime, physics::World3D &world, const ClimbingPose &pose, ClimbingIntent &intent, ClimbingCommand command, eve::SimulationTick tick, eve::SimulationTick lastGroundedTick, ClimbingServiceSubject subject)
Start one action and publish any configured stamina debit exactly once.
Definition ClimbingServices.cpp:33
Consumer-owned authority for project-specific condition tags.
Definition ClimbingServices.h:66
virtual eve::Result< ClimbingConditionDecision > evaluate(ClimbingServiceSubject subject, std::span< const std::string > requiredTags, eve::SimulationTick tick)=0
Evaluate every required tag for one subject at the injected simulation tick.
Optional post-simulation event adapter; it does not own the runtime event queue.
Definition ClimbingServices.h:78
virtual eve::Result< void > publish(ClimbingServiceSubject subject, std::span< const ClimbingEvent > events)=0
Consume an owning event view after all ECS simulation views have closed.
static constexpr const char * capabilityName
Definition ClimbingServices.h:80
Optional post-physics Animation/IK adapter consuming derived pose constraints only.
Definition ClimbingServices.h:106
Consumer-owned stamina reservation contract.
Definition ClimbingServices.h:39
virtual std::string_view adapterId() const noexcept=0
Stable adapter identity matched against ClimbingProfileDefinition::staminaAdapter.
virtual eve::Result< ClimbingStaminaReservation > prepare(ClimbingServiceSubject subject, float cost, eve::SimulationTick tick)=0
Reserve an exact non-negative cost without publishing the debit.
virtual void cancelPrepared(ClimbingStaminaReservation reservation) noexcept=0
Release an uncommitted reservation; guaranteed infallible and idempotent.
virtual void commitPrepared(ClimbingStaminaReservation reservation, ClimbingExecutionId executionId) noexcept=0
Publish a successfully prepared debit; guaranteed infallible by the provider contract.
constexpr std::uint64_t value() const noexcept
Returns the underlying value at an explicit protocol boundary.
Definition StrongUint64.h:26
static constexpr StrongUint64 zero() noexcept
Returns the zero value for this strong type.
Definition StrongUint64.h:24
constexpr bool isZero() const noexcept
Returns whether this value is zero.
Definition StrongUint64.h:28
Box3D rigid-body world. Script coordinates are meters (Box3D native), unlike 2D World which uses pixe...
Definition World3D.h:47
Definition Climbing.cpp:20
EVENGINE_API_DOMAINS void declareScriptClimbingEventSeam()
声明"`IClimbingEventSink` 可以由脚本提供"这条接缝。
Definition ClimbingServices.cpp:198
ClimbingOptionalServiceState
Observable outcome of one optional-service interaction.
Definition ClimbingServices.h:31
@ ProviderAbsent
Value climbingEventArrayValue(std::span< const ClimbingEvent > events)
一批事件 → Value 数组,顺序与传入一致。
Definition ClimbingEventValue.cpp:65
ClimbingCommandRequirement
Input edge required by an action definition; Any keeps legacy automatic selection.
Definition Climbing.h:79
ClimbingCommand
Edge and held commands understood by the climbing input phase.
Definition ClimbingInput.h:22
@ RequireProvider
eve::detail::StrongUint64< detail::ClimbingServiceSubjectTag > ClimbingServiceSubject
Stable gameplay-owned subject identity passed to optional adapters.
Definition ClimbingServices.h:26
eve::Result< ClimbingPoseResult > applyClimbingPose(animation::AnimSkeleton &skeleton, animation::AnimPose &pose, const ClimbingAdvance &advance, const ClimbingPoseBinding &binding)
Applies contact anchors to an already evaluated animation pose.
Definition ClimbingInput.cpp:177
EVENGINE_API_DOMAINS eve::Result< ClimbingOptionalServiceState > dispatchClimbingEvents(ClimbingServiceSubject subject, std::span< const ClimbingEvent > events)
Dispatch to the optional event sink, returning ProviderAbsent instead of silently dropping.
Definition ClimbingServices.cpp:122
EVENGINE_API_DOMAINS void withdrawScriptClimbingEventSeam()
撤回接缝与仍然在位的脚本适配器(由 Climbing 模块析构时调用)。
Definition ClimbingServices.cpp:231
Result< int > publish(Heightmap &target, std::vector< float > candidate)
Publish.
Definition TerrainRasterInternal.h:62
@ InvalidArgument
@ NotFound
@ PreconditionViolation
@ Unsupported
@ InvariantViolation
@ Conflict
@ NoOp
@ Applied
void recordLogEvent(const std::string &level, const std::string &message)
Appends a timestamped event line to the crash/error log.
Definition CrashLog.cpp:70
Definition Container.h:602
static ScriptArg fromTable(Value::Object fields)
One object argument (a table on the script side). @cost One Value tree copy.
Definition ScriptProvider.cpp:308
Generation-qualified identity of one published script provider.
Definition ScriptProvider.h:27
Hot authoritative intent component; contains no device or callback pointers.
Definition ClimbingInput.h:39
Input pose used for one deterministic candidate probe.
Definition Climbing.h:275