add RemoveMobPacket
This commit is contained in:
@@ -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) {}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -29,6 +29,7 @@ class UpdateCastleLifePacket;
|
||||
class UpdateMobStatesPacket;
|
||||
class PlayerBuyItemPacket;
|
||||
class PlayerBuyMobUpgradePacket;
|
||||
class RemoveMobPacket;
|
||||
|
||||
} // namespace protocol
|
||||
} // namespace td
|
||||
|
||||
@@ -33,6 +33,7 @@ enum class PacketType : std::uint8_t {
|
||||
WorldAddTower,
|
||||
UpdateMobStates,
|
||||
UpdateCastleLife,
|
||||
RemoveMob,
|
||||
|
||||
// client <--> server
|
||||
KeepAlive,
|
||||
|
||||
27
include/td/protocol/packets/RemoveMobPacket.h
Normal file
27
include/td/protocol/packets/RemoveMobPacket.h
Normal 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
|
||||
Reference in New Issue
Block a user