载入中...
搜索中...
未找到
ClimbingInput.cpp
浏览该文件的文档.
29 [&](const auto& entry) { return entry.command == command && entry.pressedTick == pressedTick; }))
34 return eve::Result<void>::failure(eve::Diagnostic::error(eve::DiagnosticCode::PreconditionViolation,
38 {command, pressedTick, eve::SimulationTick(pressedTick.value() + bufferTicks), ClimbingExecutionId::zero()});
49std::size_t ClimbingInputSystem::prune(ClimbingIntent& intent, eve::SimulationTick currentTick) noexcept {
57eve::Result<std::optional<BufferedClimbingCommand>> ClimbingInputSystem::consume(ClimbingIntent& intent,
63 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "consuming execution id must be non-zero",
66 const auto found = std::find_if(intent.commands.begin(), intent.commands.end(), [&](const auto& entry) {
78std::optional<BufferedClimbingCommand> ClimbingInputSystem::peek(const ClimbingIntent& intent, ClimbingCommand command,
80 const auto found = std::find_if(intent.commands.begin(), intent.commands.end(), [&](const auto& entry) {
81 return entry.command == command && entry.pressedTick <= currentTick && currentTick <= entry.expiryTick &&
91 return currentTick.value() - lastGroundedTick.value() <= coyoteTicks ? ClimbingCoyoteState::Eligible
Tick-addressed command buffering for deterministic climbing input.
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 std::size_t prune(ClimbingIntent &intent, eve::SimulationTick currentTick) noexcept
Remove expired and already-consumed records; returns the number removed.
Definition ClimbingInput.cpp:49
static constexpr std::size_t MaxBufferedCommands
Hard safety bound preventing an untrusted producer from growing intent indefinitely.
Definition ClimbingInput.h:55
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< void > submit(ClimbingIntent &intent, ClimbingCommand command, eve::SimulationTick pressedTick, std::uint64_t bufferTicks)
Queue one edge command with expiry derived from an exact tick budget.
Definition ClimbingInput.cpp:17
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
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
Definition Climbing.cpp:19
ClimbingCoyoteState
Named result of evaluating the deterministic grounded grace window.
Definition ClimbingInput.h:25
ClimbingCommand
Edge and held commands understood by the climbing input phase.
Definition ClimbingInput.h:22
@ InvalidArgument
@ PreconditionViolation
@ Conflict
@ NoOp
@ Applied
detail::StrongUint64< detail::SimulationTickTag > SimulationTick
Deterministic simulation time step; it is not wall-clock time.
Definition Time.h:31
One owning edge command with deterministic lifetime and consumption evidence.
Definition ClimbingInput.h:28
Hot authoritative intent component; contains no device or callback pointers.
Definition ClimbingInput.h:39
std::vector< BufferedClimbingCommand > commands
Definition ClimbingInput.h:43
Runtime profile controlling capsule geometry and probe limits.
Definition Climbing.h:218
std::uint64_t inputBufferTicks
Definition Climbing.h:234