// SPDX-License-Identifier: MPL-2.0 // Session de test scriptée : un « joueur » qui court, change de direction et saute. #pragma once #include "sequa/core/sim/input.hpp" #include "sequa/core/sim/replay.hpp" #include namespace sequa::core::sim::testing { [[nodiscard]] inline InputFrame scripted_input(Tick tick) { InputFrame input = neutral_input(tick); const Tick phase = tick % 240; if (phase < 100) { input.move_x = 32767; } else if (phase < 140) { input.move_x = 0; } else { input.move_x = -20000; } if (tick % 45 < 3) { input.buttons = button::jump; } return input; } [[nodiscard]] inline Recording record_scripted_session(std::uint64_t seed, Tick ticks, const FeelParams& feel = FeelParams{}) { SimConfig config; config.seed = seed; config.feel = feel; SessionRecorder recorder(config); for (Tick tick = 0; tick < ticks; ++tick) { recorder.step(scripted_input(tick)); } return recorder.recording(); } } // namespace sequa::core::sim::testing