19 void Serialize(uint8_t * buffer)
const override;
21 uint32_t
Size()
const override;
25 std::shared_ptr<IPacket>
Clone()
const override;
40 glm::dvec3 m_position;
41 glm::dvec3 m_displacement;
an abstract class that servers as a base for all network packets
Definition: IPacket.hpp:40
Type
Definition: IPacket.hpp:48
Definition: PlayerMovePacket.hpp:7
void SetDisplacement(glm::dvec3 displacement)
Definition: PlayerMovePacket.cpp:126
IPacket::Type GetType() const override
Get the Type of the packet.
Definition: PlayerMovePacket.cpp:91
PlayerMovePacket & operator=(const PlayerMovePacket &other)
Definition: PlayerMovePacket.cpp:23
void Deserialize(const uint8_t *buffer) override
read the packet from the buffer, the buffer must at least be of size Size()
Definition: PlayerMovePacket.cpp:66
uint64_t GetPlayerId() const
Definition: PlayerMovePacket.cpp:101
PlayerMovePacket()
Definition: PlayerMovePacket.cpp:3
void SetPlayerId(uint64_t id)
Definition: PlayerMovePacket.cpp:116
glm::dvec3 GetPosition() const
Definition: PlayerMovePacket.cpp:106
void SetPosition(glm::dvec3 position)
Definition: PlayerMovePacket.cpp:121
glm::dvec3 GetDisplacement() const
Definition: PlayerMovePacket.cpp:111
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: PlayerMovePacket.cpp:81
~PlayerMovePacket()
Definition: PlayerMovePacket.cpp:47
bool HasDynamicSize() const override
Tell if the packet has a dynamic size.
Definition: PlayerMovePacket.cpp:86
std::shared_ptr< IPacket > Clone() const override
Create a new instance of the packet.
Definition: PlayerMovePacket.cpp:96
void Serialize(uint8_t *buffer) const override
will write the packet in the buffer, the buffer must at least be of size Size()
Definition: PlayerMovePacket.cpp:51