30 lines
808 B
C++
30 lines
808 B
C++
#pragma once
|
|
|
|
#include "td/protocol/Protocol.h"
|
|
#include "td/game/BaseGame.h"
|
|
|
|
namespace td {
|
|
namespace protocol {
|
|
|
|
class UpdateCastleLifePacket : public Packet {
|
|
private:
|
|
std::uint16_t m_CastleLife;
|
|
game::TeamColor m_Team;
|
|
public:
|
|
UpdateCastleLifePacket() {}
|
|
UpdateCastleLifePacket(std::uint16_t life, game::TeamColor team) : m_CastleLife(life), m_Team(team) {}
|
|
virtual ~UpdateCastleLifePacket() {}
|
|
|
|
virtual DataBuffer Serialize(bool packetID = true) const;
|
|
virtual void Deserialize(DataBuffer& data);
|
|
virtual void Dispatch(PacketHandler* handler) const;
|
|
|
|
std::uint16_t GetCastleLife() const { return m_CastleLife; }
|
|
game::TeamColor GetTeamColor() const { return m_Team; }
|
|
|
|
virtual PacketType GetType() const { return PacketType::UpdateCastleLife; }
|
|
};
|
|
|
|
} // namespace protocol
|
|
} // namespace td
|