#pragma once #include "evo/simulation/world.hpp" #include #include namespace evo { inline constexpr std::uint32_t scheduler_version = 1; inline constexpr std::size_t max_commands_per_tick = 1'024; struct CreateEntity { Position2 position{}; }; struct RemoveEntity { EntityId id; }; struct Command { std::uint64_t sequence; std::variant operation; }; struct CommandReceipt { std::uint64_t sequence; EntityId entity; auto operator<=>(const CommandReceipt&) const = default; }; enum class ScheduleErrorCode : std::uint8_t { wrong_tick, batch_limit, invalid_sequence, duplicate_sequence, simulation_failure }; struct ScheduleError { ScheduleErrorCode code; std::uint64_t sequence{}; std::optional cause{}; }; // Single-owner call. No input is retained. Rejection leaves world unchanged. // target is the next completed tick; receipts follow ascending sequence. [[nodiscard]] std::expected, ScheduleError> advance(SimulationWorld& world, Tick target, std::span commands = {}); } // namespace evo