switch to using own event system
This commit is contained in:
@@ -5,28 +5,30 @@
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include "BuilderModeExitedEvent.h"
|
||||
#include "BuildingType.h"
|
||||
#include "DemolishModeChangedEvent.h"
|
||||
#include "EventHandler.h"
|
||||
#include "GameConfig.h"
|
||||
|
||||
class QPushButton;
|
||||
|
||||
class BuildButtonGrid : public QWidget
|
||||
class BuildButtonGrid : public QWidget,
|
||||
public CombinedEventHandler<BuilderModeExitedEvent,
|
||||
DemolishModeChangedEvent>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BuildButtonGrid(const GameConfig* config, QWidget* parent = nullptr);
|
||||
~BuildButtonGrid() override;
|
||||
|
||||
void updateAffordability(int buildingBlocks);
|
||||
void clearActiveButton();
|
||||
|
||||
signals:
|
||||
void buildingTypeSelected(BuildingType type);
|
||||
void builderModeExited();
|
||||
void demolishModeToggleRequested();
|
||||
|
||||
public slots:
|
||||
void setDemolishModeActive(bool active);
|
||||
private:
|
||||
void handleEvent(std::shared_ptr<const BuilderModeExitedEvent> event) override;
|
||||
void handleEvent(std::shared_ptr<const DemolishModeChangedEvent> event) override;
|
||||
|
||||
private slots:
|
||||
void onBuildButton(int index);
|
||||
|
||||
Reference in New Issue
Block a user