replace combined stateUpdated signal with individual events
This commit is contained in:
@@ -4,21 +4,27 @@
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "BossWaveUpdatedEvent.h"
|
||||
#include "BuildingBlocksChangedEvent.h"
|
||||
#include "EventHandler.h"
|
||||
#include "GameSpeedChangedEvent.h"
|
||||
#include "Tick.h"
|
||||
#include "TickAdvancedEvent.h"
|
||||
|
||||
class QLabel;
|
||||
class QPushButton;
|
||||
|
||||
class HeaderBar : public QWidget
|
||||
class HeaderBar : public QWidget,
|
||||
public CombinedEventHandler<TickAdvancedEvent,
|
||||
BuildingBlocksChangedEvent,
|
||||
GameSpeedChangedEvent,
|
||||
BossWaveUpdatedEvent>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit HeaderBar(QWidget* parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void onStateUpdated(Tick tick, int buildingBlocks, double gameSpeed,
|
||||
int bossCounter, Tick bossCountdownTicks);
|
||||
~HeaderBar() override;
|
||||
|
||||
signals:
|
||||
void speedChanged(double multiplier);
|
||||
@@ -27,6 +33,11 @@ private slots:
|
||||
void onSpeedButton(int index);
|
||||
|
||||
private:
|
||||
void handleEvent(std::shared_ptr<const TickAdvancedEvent> event) override;
|
||||
void handleEvent(std::shared_ptr<const BuildingBlocksChangedEvent> event) override;
|
||||
void handleEvent(std::shared_ptr<const GameSpeedChangedEvent> event) override;
|
||||
void handleEvent(std::shared_ptr<const BossWaveUpdatedEvent> event) override;
|
||||
|
||||
QLabel* m_timeLabel;
|
||||
QLabel* m_blocksLabel;
|
||||
QLabel* m_bossLabel;
|
||||
|
||||
Reference in New Issue
Block a user