25 void Serialize(uint8_t * buffer)
const override;
27 uint32_t
Size()
const override;
31 std::shared_ptr<IPacket>
Clone()
const override;
Definition: BlockActionPacket.hpp:7
void SetBlockID(BlockInfo::Type block_id)
Definition: BlockActionPacket.cpp:116
void Serialize(uint8_t *buffer) const override
will write the packet in the buffer, the buffer must at least be of size Size()
Definition: BlockActionPacket.cpp:50
bool HasDynamicSize() const override
Tell if the packet has a dynamic size.
Definition: BlockActionPacket.cpp:86
Action GetAction() const
Definition: BlockActionPacket.cpp:111
glm::vec3 GetPosition() const
Definition: BlockActionPacket.cpp:106
BlockInfo::Type GetBlockID() const
Definition: BlockActionPacket.cpp:101
void Deserialize(const uint8_t *buffer) override
read the packet from the buffer, the buffer must at least be of size Size()
Definition: BlockActionPacket.cpp:66
~BlockActionPacket()
Definition: BlockActionPacket.cpp:46
BlockActionPacket()
Definition: BlockActionPacket.cpp:3
IPacket::Type GetType() const override
Get the Type of the packet.
Definition: BlockActionPacket.cpp:91
Action
Definition: BlockActionPacket.hpp:10
BlockActionPacket & operator=(const BlockActionPacket &other)
Definition: BlockActionPacket.cpp:17
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: BlockActionPacket.cpp:81
void SetAction(Action action)
Definition: BlockActionPacket.cpp:126
void SetPosition(glm::vec3 position)
Definition: BlockActionPacket.cpp:121
std::shared_ptr< IPacket > Clone() const override
Create a new instance of the packet.
Definition: BlockActionPacket.cpp:96
Type
Definition: Block.hpp:33
an abstract class that servers as a base for all network packets
Definition: IPacket.hpp:40
Type
Definition: IPacket.hpp:48