Codechange: add accessor for the packet type to Packet and make the internal state of Packet private
This commit is contained in:
@@ -296,6 +296,16 @@ void Packet::PrepareToRead()
|
||||
this->pos = sizeof(PacketSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the \c PacketType from this packet.
|
||||
* @return The packet type.
|
||||
*/
|
||||
PacketType Packet::GetPacketType() const
|
||||
{
|
||||
assert(this->Size() >= sizeof(PacketSize) + sizeof(PacketType));
|
||||
return static_cast<PacketType>(buffer[sizeof(PacketSize)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a boolean from the packet.
|
||||
* @return The read data.
|
||||
|
Reference in New Issue
Block a user