47 explicit ServerLoop(std::unique_ptr<IGameLogic> gameLogic, std::shared_ptr<EventBus> eventBus,
48 float gameSpeedMultiplier = 1.0f);
65 void start()
override;
94 std::shared_ptr<ecs::wrapper::ECSWorld>
getECSWorld();
Type-safe event publication/subscription system.
Utility class to measure frame durations.
Interface for server-side game logic orchestration.
Interface for the main server loop.
Deterministic fixed-timestep game loop.
float getGameSpeedMultiplier() const
Get the game speed multiplier.
uint32_t getCurrentTick() const
Get the current server tick.
std::shared_ptr< ecs::wrapper::ECSWorld > getECSWorld()
Get reference to ECS world from GameLogic.
void _fixedUpdate()
Process a single fixed timestep update.
~ServerLoop() override
Destructor - ensures clean shutdown.
void _gameLoopThread(std::stop_token stopToken)
Main game loop function (runs in thread)
void stop() override
Stop the game loop (IServerLoop implementation)
static constexpr float MAX_FRAME_ACCUMULATOR
IGameLogic & getGameLogic()
Get reference to game logic.
bool isRunning() const override
Check if game loop is running (IServerLoop implementation)
std::unique_ptr< IGameLogic > _gameLogic
bool initialize()
Initialize the game loop.
void start() override
Start the game loop (IServerLoop implementation) Runs in background thread.
std::atomic< bool > _initialized
std::shared_ptr< EventBus > _eventBus
static constexpr float BASE_FIXED_TIMESTEP
float _gameSpeedMultiplier