replace combined stateUpdated signal with individual events
This commit is contained in:
@@ -5,7 +5,9 @@
|
||||
#include <QWidget>
|
||||
|
||||
#include "Blueprint.h"
|
||||
#include "BuildingBlocksChangedEvent.h"
|
||||
#include "BuildingId.h"
|
||||
#include "EventHandler.h"
|
||||
#include "GameConfig.h"
|
||||
#include "Tick.h"
|
||||
|
||||
@@ -14,22 +16,26 @@ class QPushButton;
|
||||
class QScrollArea;
|
||||
class QVBoxLayout;
|
||||
|
||||
class BlueprintPanel : public QWidget
|
||||
class BlueprintPanel : public QWidget,
|
||||
public EventHandler<BuildingBlocksChangedEvent>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BlueprintPanel(Simulation* sim, const GameConfig* config, QWidget* parent = nullptr);
|
||||
~BlueprintPanel() override;
|
||||
|
||||
public slots:
|
||||
void onSelectionChanged(const std::vector<BuildingId>& ids);
|
||||
void onStateUpdated(Tick tick, int blocks, double speed);
|
||||
void clearActiveBlueprintButton();
|
||||
|
||||
signals:
|
||||
void blueprintPlacementRequested(Blueprint blueprint);
|
||||
void exitBlueprintModeRequested();
|
||||
|
||||
private:
|
||||
void handleEvent(std::shared_ptr<const BuildingBlocksChangedEvent> event) override;
|
||||
|
||||
private slots:
|
||||
void onCreateClicked();
|
||||
void onDeleteBlueprintClicked(int index);
|
||||
|
||||
Reference in New Issue
Block a user