switch to using own event system

This commit is contained in:
2026-06-13 17:42:16 +02:00
parent ed17664ef1
commit 5317f35198
49 changed files with 611 additions and 300 deletions

View File

@@ -7,7 +7,10 @@
#include "BuildingBlocksChangedEvent.h"
#include "BuildingId.h"
#include "EscapeMenuRequestedEvent.h"
#include "EventHandler.h"
#include "GameOverEvent.h"
#include "LayoutDialogRequestedEvent.h"
#include "SchematicChoicesAvailableEvent.h"
#include "ShipLayoutBlueprint.h"
#include "Tick.h"
@@ -24,7 +27,10 @@ class QResizeEvent;
class MainWindow : public QWidget,
public CombinedEventHandler<BuildingBlocksChangedEvent,
SchematicChoicesAvailableEvent>
SchematicChoicesAvailableEvent,
GameOverEvent,
EscapeMenuRequestedEvent,
LayoutDialogRequestedEvent>
{
Q_OBJECT
@@ -39,13 +45,11 @@ protected:
private:
void handleEvent(std::shared_ptr<const BuildingBlocksChangedEvent> event) override;
void handleEvent(std::shared_ptr<const SchematicChoicesAvailableEvent> event) override;
void handleEvent(std::shared_ptr<const GameOverEvent> event) override;
void handleEvent(std::shared_ptr<const EscapeMenuRequestedEvent> event) override;
void handleEvent(std::shared_ptr<const LayoutDialogRequestedEvent> event) override;
void layoutPanels();
private slots:
void onGameOver();
void onEscapeMenuRequested();
void onLayoutDialogRequested(BuildingId shipyardId);
private:
std::string m_configDir;
VisualsConfig m_visuals;