R-Type
R-Type project
KapMirror::MessagePacking Class Reference

Static Public Member Functions

template<typename T >
static ushort getId ()
 Gerenate a ID from a message type. More...
 
template<typename T >
static void pack (T &message, NetworkWriter &writer)
 Pack a message to a byte array with the message ID. More...
 
static void unpack (NetworkReader &reader, ushort &messageType)
 Unpack a message from a byte array. More...
 

Member Function Documentation

◆ getId()

template<typename T >
static ushort KapMirror::MessagePacking::getId ( )
inlinestatic

Gerenate a ID from a message type.

Template Parameters
TThe message type
Returns
ID of the message type

◆ pack()

template<typename T >
static void KapMirror::MessagePacking::pack ( T &  message,
NetworkWriter writer 
)
inlinestatic

Pack a message to a byte array with the message ID.

Template Parameters
TThe message type
Parameters
messageThe message
writerThe NetworkWriter

◆ unpack()

static void KapMirror::MessagePacking::unpack ( NetworkReader reader,
ushort &  messageType 
)
inlinestatic

Unpack a message from a byte array.

Template Parameters
TThe message type
Parameters
readerThe NetworkReader
messageTypeThe message type

The documentation for this class was generated from the following file: