23 void Serialize(uint8_t * buffer)
const override;
25 uint32_t
Size()
const override;
29 std::shared_ptr<IPacket>
Clone()
const override;
35 const std::vector<PlayerInfo> &
GetPlayers()
const;
37 void SetPlayers(
const std::vector<PlayerInfo> & players);
39 std::vector<PlayerInfo> m_players;
an abstract class that servers as a base for all network packets
Definition: IPacket.hpp:40
Type
Definition: IPacket.hpp:48
Definition: PlayerListPacket.hpp:7
const std::vector< PlayerInfo > & GetPlayers() const
Definition: PlayerListPacket.cpp:107
PlayerListPacket & operator=(const PlayerListPacket &other)
Definition: PlayerListPacket.cpp:26
void Serialize(uint8_t *buffer) const override
will write the packet in the buffer, the buffer must at least be of size Size()
Definition: PlayerListPacket.cpp:46
~PlayerListPacket()
Definition: PlayerListPacket.cpp:7
bool HasDynamicSize() const override
Tell if the packet has a dynamic size.
Definition: PlayerListPacket.cpp:92
std::shared_ptr< IPacket > Clone() const override
Create a new instance of the packet.
Definition: PlayerListPacket.cpp:102
void SetPlayers(const std::vector< PlayerInfo > &players)
Definition: PlayerListPacket.cpp:112
PlayerListPacket()
Definition: PlayerListPacket.cpp:3
IPacket::Type GetType() const override
Get the Type of the packet.
Definition: PlayerListPacket.cpp:97
void Deserialize(const uint8_t *buffer) override
read the packet from the buffer, the buffer must at least be of size Size()
Definition: PlayerListPacket.cpp:60
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: PlayerListPacket.cpp:87
Definition: PlayerListPacket.hpp:10
glm::dvec3 position
Definition: PlayerListPacket.hpp:12
uint64_t id
Definition: PlayerListPacket.hpp:11