diff --git a/src/lib/eventsystem/event/ArtifactCountChangedEvent.h b/src/lib/eventsystem/event/ArtifactCountChangedEvent.h index 258d99b..31d5ad2 100644 --- a/src/lib/eventsystem/event/ArtifactCountChangedEvent.h +++ b/src/lib/eventsystem/event/ArtifactCountChangedEvent.h @@ -2,10 +2,9 @@ #include "Event.h" +// Fired when the collected artifact count changes. Carries no payload — +// subscribers re-read Simulation::getArtifactCount(), and the win count from +// world.artifacts.artifactWinCount. class ArtifactCountChangedEvent : public Event { -public: - ArtifactCountChangedEvent(int count, int winCount) : count(count), winCount(winCount) {} - const int count; - const int winCount; }; diff --git a/src/lib/eventsystem/event/BossWaveUpdatedEvent.h b/src/lib/eventsystem/event/BossWaveUpdatedEvent.h index 5fbf24d..47ff228 100644 --- a/src/lib/eventsystem/event/BossWaveUpdatedEvent.h +++ b/src/lib/eventsystem/event/BossWaveUpdatedEvent.h @@ -2,16 +2,11 @@ #define BOSS_WAVE_UPDATED_EVENT_H #include "Event.h" -#include "Tick.h" +// Fired when the boss wave counter or its countdown changes. Carries no payload — +// subscribers re-read Simulation::getBossWaveCounter() and getBossCountdownTicks(). class BossWaveUpdatedEvent : public Event { -public: - BossWaveUpdatedEvent(int counter, Tick countdownTicks) - : counter(counter), countdownTicks(countdownTicks) {} - const int counter; - const Tick countdownTicks; }; #endif // BOSS_WAVE_UPDATED_EVENT_H - diff --git a/src/lib/eventsystem/event/BuildingBlocksChangedEvent.h b/src/lib/eventsystem/event/BuildingBlocksChangedEvent.h index 2b02b8a..62e0706 100644 --- a/src/lib/eventsystem/event/BuildingBlocksChangedEvent.h +++ b/src/lib/eventsystem/event/BuildingBlocksChangedEvent.h @@ -3,12 +3,10 @@ #include "Event.h" +// Fired when the building block stock changes. Carries no payload — subscribers +// re-read Simulation::getBuildingBlocksStock(). class BuildingBlocksChangedEvent : public Event { -public: - explicit BuildingBlocksChangedEvent(int blocks) : blocks(blocks) {} - const int blocks; }; #endif // BUILDING_BLOCKS_CHANGED_EVENT_H - diff --git a/src/lib/eventsystem/event/ExpansionCostChangedEvent.h b/src/lib/eventsystem/event/ExpansionCostChangedEvent.h index dcd7b1e..682e90e 100644 --- a/src/lib/eventsystem/event/ExpansionCostChangedEvent.h +++ b/src/lib/eventsystem/event/ExpansionCostChangedEvent.h @@ -4,14 +4,11 @@ #include "Event.h" // Fired when the current asteroid-expansion cost changes (REQ-EXP-COST): once at -// startup and again after each expansion is purchased. Carries the cost in -// building blocks so the header Expand button can update its caption/enabled -// state (REQ-UI-EXPAND-BUTTON). +// startup and again after each expansion is purchased. Carries no payload — the +// header Expand button re-reads Simulation::getCurrentExpansionCost() to update +// its caption and enabled state (REQ-UI-EXPAND-BUTTON). class ExpansionCostChangedEvent : public Event { -public: - explicit ExpansionCostChangedEvent(int cost) : cost(cost) {} - const int cost; }; #endif // EXPANSION_COST_CHANGED_EVENT_H diff --git a/src/lib/eventsystem/event/TickAdvancedEvent.h b/src/lib/eventsystem/event/TickAdvancedEvent.h index 3f95ccb..01567c1 100644 --- a/src/lib/eventsystem/event/TickAdvancedEvent.h +++ b/src/lib/eventsystem/event/TickAdvancedEvent.h @@ -2,14 +2,11 @@ #define TICK_ADVANCED_EVENT_H #include "Event.h" -#include "Tick.h" +// Fired when the simulation tick advances. Carries no payload — subscribers +// re-read Simulation::getCurrentTick(). class TickAdvancedEvent : public Event { -public: - explicit TickAdvancedEvent(Tick tick) : tick(tick) {} - const Tick tick; }; #endif // TICK_ADVANCED_EVENT_H - diff --git a/src/ui/GameWorldView.cpp b/src/ui/GameWorldView.cpp index 7b22056..518ca33 100644 --- a/src/ui/GameWorldView.cpp +++ b/src/ui/GameWorldView.cpp @@ -403,26 +403,26 @@ void GameWorldView::onFrame() { m_lastTick = newTick; EventManager::getInstance()->sendEventImmediately( - std::make_shared(newTick)); + std::make_shared()); } if (newBlocks != m_lastBlocks) { m_lastBlocks = newBlocks; EventManager::getInstance()->sendEventImmediately( - std::make_shared(newBlocks)); + std::make_shared()); } if (newExpCost != m_lastExpansionCost) { m_lastExpansionCost = newExpCost; EventManager::getInstance()->sendEventImmediately( - std::make_shared(newExpCost)); + std::make_shared()); } if (newBoss != m_lastBossCounter || newCountdown != m_lastBossCountdown) { m_lastBossCounter = newBoss; m_lastBossCountdown = newCountdown; EventManager::getInstance()->sendEventImmediately( - std::make_shared(newBoss, newCountdown)); + std::make_shared()); } // Unlocked building set changes only after a drop is applied or on Restart @@ -485,8 +485,7 @@ void GameWorldView::onFrame() { m_lastArtifactCount = currentArtifactCount; EventManager::getInstance()->sendEventImmediately( - std::make_shared( - currentArtifactCount, m_sim->getConfig().world.artifacts.artifactWinCount)); + std::make_shared()); } update();