18 void Serialize(uint8_t * buffer)
const override;
20 uint32_t
Size()
const override;
24 std::shared_ptr<IPacket>
Clone()
const override;
an abstract class that servers as a base for all network packets
Definition: IPacket.hpp:40
Type
Definition: IPacket.hpp:48
Definition: PlayerConnectedPacket.hpp:6
void SetPlayerId(uint32_t id)
Definition: PlayerConnectedPacket.cpp:88
bool HasDynamicSize() const override
Tell if the packet has a dynamic size.
Definition: PlayerConnectedPacket.cpp:68
void Deserialize(const uint8_t *buffer) override
read the packet from the buffer, the buffer must at least be of size Size()
Definition: PlayerConnectedPacket.cpp:55
uint32_t GetPlayerId() const
Definition: PlayerConnectedPacket.cpp:83
virtual ~PlayerConnectedPacket()
Definition: PlayerConnectedPacket.cpp:12
IPacket::Type GetType() const override
Get the Type of the packet.
Definition: PlayerConnectedPacket.cpp:73
std::shared_ptr< IPacket > Clone() const override
Create a new instance of the packet.
Definition: PlayerConnectedPacket.cpp:78
PlayerConnectedPacket()
Definition: PlayerConnectedPacket.cpp:3
void Serialize(uint8_t *buffer) const override
will write the packet in the buffer, the buffer must at least be of size Size()
Definition: PlayerConnectedPacket.cpp:46
PlayerConnectedPacket & operator=(const PlayerConnectedPacket &other)
Definition: PlayerConnectedPacket.cpp:26
uint32_t Size() const override
return the size of the packet in bytes, usually used to reserve the right amount of memory in the sen...
Definition: PlayerConnectedPacket.cpp:63