20 void Serialize(uint8_t * buffer)
const override;
22 uint32_t
Size()
const override;
26 std::shared_ptr<IPacket>
Clone()
const override;
Definition: ConnectionPacket.hpp:7
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: ConnectionPacket.cpp:72
std::shared_ptr< IPacket > Clone() const override
Create a new instance of the packet.
Definition: ConnectionPacket.cpp:82
void SetPosition(glm::vec3 position)
Definition: ConnectionPacket.cpp:107
bool HasDynamicSize() const override
Tell if the packet has a dynamic size.
Definition: ConnectionPacket.cpp:77
ConnectionPacket & operator=(const ConnectionPacket &other)
Definition: ConnectionPacket.cpp:17
void Deserialize(const uint8_t *buffer) override
read the packet from the buffer, the buffer must at least be of size Size()
Definition: ConnectionPacket.cpp:60
uint32_t GetPlayerId() const
Definition: ConnectionPacket.cpp:92
ConnectionPacket()
Definition: ConnectionPacket.cpp:3
void SetPlayerId(uint32_t id)
Definition: ConnectionPacket.cpp:102
void Serialize(uint8_t *buffer) const override
will write the packet in the buffer, the buffer must at least be of size Size()
Definition: ConnectionPacket.cpp:46
IPacket::Type GetType() const override
Get the Type of the packet.
Definition: ConnectionPacket.cpp:87
glm::vec3 GetPosition() const
Definition: ConnectionPacket.cpp:97
~ConnectionPacket()
Definition: ConnectionPacket.cpp:42
an abstract class that servers as a base for all network packets
Definition: IPacket.hpp:40
Type
Definition: IPacket.hpp:48