17 void Serialize(uint8_t * buffer)
const override;
19 uint32_t
Size()
const override;
23 std::shared_ptr<IPacket>
Clone()
const override;
32 glm::ivec3 m_chunk_pos;
Definition: ChunkRequestPacket.hpp:7
bool HasDynamicSize() const override
Tell if the packet has a dynamic size.
Definition: ChunkRequestPacket.cpp:56
ChunkRequestPacket()
Definition: ChunkRequestPacket.cpp:3
std::shared_ptr< IPacket > Clone() const override
Create a new instance of the packet.
Definition: ChunkRequestPacket.cpp:66
ChunkRequestPacket & operator=(ChunkRequestPacket &other)
Definition: ChunkRequestPacket.cpp:17
glm::ivec3 GetChunkPos() const
Definition: ChunkRequestPacket.cpp:71
void Serialize(uint8_t *buffer) const override
will write the packet in the buffer, the buffer must at least be of size Size()
Definition: ChunkRequestPacket.cpp:34
IPacket::Type GetType() const override
Get the Type of the packet.
Definition: ChunkRequestPacket.cpp:61
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: ChunkRequestPacket.cpp:51
~ChunkRequestPacket()
Definition: ChunkRequestPacket.cpp:7
void Deserialize(const uint8_t *buffer) override
read the packet from the buffer, the buffer must at least be of size Size()
Definition: ChunkRequestPacket.cpp:43
void SetChunkPos(const glm::ivec3 &chunk_pos)
Definition: ChunkRequestPacket.cpp:76
an abstract class that servers as a base for all network packets
Definition: IPacket.hpp:40
Type
Definition: IPacket.hpp:48