add event system and use it to propagate to print traces

This commit is contained in:
2026-06-05 17:18:17 +02:00
parent abc261c03a
commit 9677133c54
14 changed files with 369 additions and 10 deletions

View File

@@ -10,15 +10,16 @@
#include "BeltSystem.h"
#include "EntityAdmin.h"
#include "entt/entity/entity.hpp"
#include "SchematicDropEvent.h"
#include "BuildingType.h"
#include "BuildingId.h"
#include "EventHandler.h"
#include "FireEvent.h"
#include "GameConfig.h"
#include "Rotation.h"
#include "Tick.h"
#include "TracePrintRequestedEvent.h"
class AiSystem;
class BuildingSystem;
@@ -29,7 +30,7 @@ class ShipSystem;
class ScrapSystem;
class WaveSystem;
class Simulation
class Simulation: public CombinedEventHandler<TracePrintRequestedEvent>
{
public:
explicit Simulation(GameConfig config, unsigned int seed = 0);
@@ -83,6 +84,8 @@ public:
const EntityAdmin& admin() const;
private:
void handleEvent(std::shared_ptr<const TracePrintRequestedEvent> event) override;
BuildingId allocateBuildingId(); // Strictly increasing; never returns kInvalidBuildingId.
// Populate HQ, player defence stations, and the first enemy station set.