19 void Serialize(uint8_t * buffer)
const override;
21 uint32_t
Size()
const override;
25 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: LoadDistancePacket.hpp:7
void Deserialize(const uint8_t *buffer) override
read the packet from the buffer, the buffer must at least be of size Size()
Definition: LoadDistancePacket.cpp:57
LoadDistancePacket()
Definition: LoadDistancePacket.cpp:3
IPacket::Type GetType() const override
Get the Type of the packet.
Definition: LoadDistancePacket.cpp:77
bool HasDynamicSize() const override
Tell if the packet has a dynamic size.
Definition: LoadDistancePacket.cpp:72
LoadDistancePacket & operator=(const LoadDistancePacket &other)
Definition: LoadDistancePacket.cpp:22
uint32_t GetDistance() const
Definition: LoadDistancePacket.cpp:87
void SetDistance(uint32_t distance)
Definition: LoadDistancePacket.cpp:92
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: LoadDistancePacket.cpp:67
std::shared_ptr< IPacket > Clone() const override
Create a new instance of the packet.
Definition: LoadDistancePacket.cpp:82
~LoadDistancePacket()
Definition: LoadDistancePacket.cpp:42
void Serialize(uint8_t *buffer) const override
will write the packet in the buffer, the buffer must at least be of size Size()
Definition: LoadDistancePacket.cpp:46