diff --git a/include/td/simulation/CommandApply.h b/include/td/simulation/CommandApply.h index b16dfe2..92d57d0 100644 --- a/include/td/simulation/CommandApply.h +++ b/include/td/simulation/CommandApply.h @@ -14,7 +14,13 @@ class CommandApply : public protocol::CommandHandler { public: CommandApply(const game::World& a_World, WorldSnapshot& a_Snapshot); + virtual void Handle(const protocol::commands::EndCommand& a_End) override; + virtual void Handle(const protocol::commands::PlaceTowerCommand& a_PlaceTower) override; + virtual void Handle(const protocol::commands::PlayerJoinCommand& a_PlayerJoin) override; virtual void Handle(const protocol::commands::SpawnTroopCommand& a_SpawnTroop) override; + virtual void Handle(const protocol::commands::TeamChangeCommand& a_TeamChange) override; + virtual void Handle(const protocol::commands::UpgradeTowerCommand& a_UpgradeTower) override; + virtual void Handle(const protocol::commands::UseItemCommand& a_UseItem) override; }; } // namespace sim diff --git a/src/td/simulation/CommandApply.cpp b/src/td/simulation/CommandApply.cpp index 852ef6d..02a1beb 100644 --- a/src/td/simulation/CommandApply.cpp +++ b/src/td/simulation/CommandApply.cpp @@ -5,11 +5,21 @@ namespace sim { CommandApply::CommandApply(const game::World& a_World, WorldSnapshot& a_Snapshot) : m_World(a_World), m_Snapshot(a_Snapshot) {} +void CommandApply::Handle(const protocol::commands::EndCommand& a_End) {} +void CommandApply::Handle(const protocol::commands::PlaceTowerCommand& a_PlaceTower) { + m_World.CanPlaceBigTower({}, 0); +} +void CommandApply::Handle(const protocol::commands::PlayerJoinCommand& a_PlayerJoin) {} + void CommandApply::Handle(const protocol::commands::SpawnTroopCommand& a_SpawnTroop) { auto zombie = std::make_shared(); zombie->m_Position = a_SpawnTroop->m_Position; m_Snapshot.m_Mobs.push_back(zombie); } +void CommandApply::Handle(const protocol::commands::TeamChangeCommand& a_TeamChange) {} +void CommandApply::Handle(const protocol::commands::UpgradeTowerCommand& a_UpgradeTower) {} +void CommandApply::Handle(const protocol::commands::UseItemCommand& a_UseItem) {} + } // namespace sim } // namespace td