载入中...
搜索中...
未找到
ClimbingServices.cpp
浏览该文件的文档.
21 ClimbingRuntime& runtime, physics::World3D& world, const ClimbingPose& pose, ClimbingIntent& intent,
25 return eve::Result<ClimbingServiceStart>::failure(eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument,
30 eve::DiagnosticCode::NotFound, "climbing.input.no_match", "intent.commands", {}, "climbing.services"));
48 eve::DiagnosticCode::Unsupported, "required climbing condition provider is absent", "conditions", {},
50 auto decision = conditions->evaluate(subject, prepared.value().action.requiredConditionTags, tick);
54 eve::DiagnosticCode::PreconditionViolation, "climbing action conditions were denied", "conditions", {},
67 eve::Diagnostic::error(eve::DiagnosticCode::Unsupported, "required climbing stamina provider is absent",
82 eve::DiagnosticCode::InvariantViolation, "stamina provider returned a zero reservation", "stamina",
89 auto consumed = ClimbingInputSystem::consume(intent, command, tick, prepared.value().executionId);
95 eve::Diagnostic::error(eve::DiagnosticCode::Conflict, "eligible climbing input changed before commit",
105 return eve::Result<ClimbingServiceStart>::success({std::move(committed).takeValue(), staminaState},
113 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "service subject must be non-zero", "subject",
129 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "service subject must be non-zero", "subject",
Consumer-owned contracts for optional stamina, event, and pose integrations.
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 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
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:87
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:57
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:78
Owner-thread climbing planner and executor for one character.
Definition Climbing.h:653
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:20
Consumer-owned authority for project-specific condition tags.
Definition ClimbingServices.h:67
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:79
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.
Optional post-physics Animation/IK adapter consuming derived pose constraints only.
Definition ClimbingServices.h:90
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:63
Definition Climbing.cpp:19
ClimbingOptionalServiceState
Observable outcome of one optional-service interaction.
Definition ClimbingServices.h:31
@ ProviderAbsent
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::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 ClimbingPose.cpp:34
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:109
@ InvalidArgument
@ NotFound
@ PreconditionViolation
@ Unsupported
@ InvariantViolation
@ Conflict
@ NoOp
@ Applied
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