#pragma once #include #include #include "ArtifactCountChangedEvent.h" #include "BossWaveUpdatedEvent.h" #include "BuildingBlocksChangedEvent.h" #include "EventHandler.h" #include "ExpansionCostChangedEvent.h" #include "GameConfig.h" #include "GameSpeedChangedEvent.h" #include "Tick.h" #include "TickAdvancedEvent.h" class QLabel; class QPushButton; class HeaderBar : public QWidget, public CombinedEventHandler { Q_OBJECT public: explicit HeaderBar(const GameConfig* config, QWidget* parent = nullptr); ~HeaderBar() override; private slots: void onSpeedButton(int index); private: void handleEvent(std::shared_ptr event) override; void handleEvent(std::shared_ptr event) override; void handleEvent(std::shared_ptr event) override; void handleEvent(std::shared_ptr event) override; void handleEvent(std::shared_ptr event) override; void handleEvent(std::shared_ptr event) override; // Refreshes the Expand button caption and enabled state from the current // expansion cost and building block stock (REQ-UI-EXPAND-BUTTON). void updateExpandButton(); QLabel* m_timeLabel; QLabel* m_blocksLabel; QLabel* m_artifactsLabel; QLabel* m_bossLabel; QPushButton* m_expandButton; std::vector m_speedButtons; int m_blocks = 0; int m_expansionCost = 0; static const double kSpeeds[]; static const int kSpeedCount; };