add RemoveMobPacket

This commit is contained in:
Simon Pribylski
2023-08-26 10:35:26 +02:00
parent 51ec035490
commit 8e7b446003
8 changed files with 52 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ public:
virtual void HandlePacket(const PlayerLeavePacket* packet) {}
virtual void HandlePacket(const PlayerListPacket* packet) {}
virtual void HandlePacket(const PlayerLoginPacket* packet) {}
virtual void HandlePacket(const RemoveMobPacket* packet) {}
virtual void HandlePacket(const RemoveTowerPacket* packet) {}
virtual void HandlePacket(const SelectTeamPacket* packet) {}
virtual void HandlePacket(const SendMobsPacket* packet) {}

View File

@@ -8,6 +8,7 @@
#include "packets/PlayerLeavePacket.h"
#include "packets/PlayerListPacket.h"
#include "packets/PlayerLoginPacket.h"
#include "packets/RemoveMobPacket.h"
#include "packets/RemoveTowerPacket.h"
#include "packets/SelectTeamPacket.h"
#include "packets/SendMobsPacket.h"

View File

@@ -29,6 +29,7 @@ class UpdateCastleLifePacket;
class UpdateMobStatesPacket;
class PlayerBuyItemPacket;
class PlayerBuyMobUpgradePacket;
class RemoveMobPacket;
} // namespace protocol
} // namespace td

View File

@@ -33,6 +33,7 @@ enum class PacketType : std::uint8_t {
WorldAddTower,
UpdateMobStates,
UpdateCastleLife,
RemoveMob,
// client <--> server
KeepAlive,

View File

@@ -0,0 +1,27 @@
#pragma once
#include "td/protocol/Protocol.h"
#include "td/game/BaseGame.h"
namespace td {
namespace protocol {
class RemoveMobPacket : public Packet {
private:
game::MobID m_MobID;
public:
RemoveMobPacket() {}
RemoveMobPacket(game::MobID id) : m_MobID(id) {}
virtual ~RemoveMobPacket() {}
virtual DataBuffer Serialize(bool packetID = true) const;
virtual void Deserialize(DataBuffer& data);
virtual void Dispatch(PacketHandler* handler) const;
game::MobID GetMobID() const { return m_MobID; }
virtual PacketType GetType() const { return PacketType::RemoveMob; }
};
} // namespace protocol
} // namespace td