32 lines
922 B
C++
32 lines
922 B
C++
#pragma once
|
|
|
|
#include "td/protocol/Protocol.h"
|
|
#include "td/game/BaseGame.h"
|
|
|
|
namespace td {
|
|
namespace protocol {
|
|
|
|
/** Packet used by the client to buy mob upgrades
|
|
Packet used by the server to confirm transaction */
|
|
class PlayerBuyMobUpgradePacket : public Packet {
|
|
private:
|
|
game::MobType m_MobType;
|
|
std::uint8_t m_MobLevel;
|
|
public:
|
|
PlayerBuyMobUpgradePacket() {}
|
|
PlayerBuyMobUpgradePacket(game::MobType mobType, std::uint8_t level) : m_MobType(mobType), m_MobLevel(level) {}
|
|
virtual ~PlayerBuyMobUpgradePacket() {}
|
|
|
|
virtual DataBuffer Serialize(bool packetID = true) const;
|
|
virtual void Deserialize(DataBuffer& data);
|
|
virtual void Dispatch(PacketHandler* handler) const;
|
|
|
|
game::MobType GetMobType() const { return m_MobType; }
|
|
std::uint8_t GetLevel() const { return m_MobLevel; }
|
|
|
|
virtual PacketType GetType() const { return PacketType::PlayerBuyMobUpgrade; }
|
|
};
|
|
|
|
} // namespace protocol
|
|
} // namespace td
|