VOX
A little voxel engine
Loading...
Searching...
No Matches
ChunkRequestPacket.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "IPacket.hpp"
4#include "glm/glm.hpp"
5
7{
8public:
11
16
17 void Serialize(uint8_t * buffer) const override;
18 void Deserialize(const uint8_t * buffer) override;
19 uint32_t Size() const override;
20 bool HasDynamicSize() const override;
21 IPacket::Type GetType() const override;
22
23 std::shared_ptr<IPacket> Clone() const override;
24
25 /*******************************
26 * ATTRIBUTES
27 ********************************/
28 glm::ivec3 GetChunkPos() const;
29
30 void SetChunkPos(const glm::ivec3 & chunk_pos);
31private:
32 glm::ivec3 m_chunk_pos;
33};
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