22 lines
414 B
C#
22 lines
414 B
C#
|
using LiteNetLib.Utils;
|
||
|
|
||
|
namespace Syntriax.Engine.Network.Abstract;
|
||
|
|
||
|
public class NetworkPacket<T>()
|
||
|
: INetSerializable
|
||
|
where T : INetSerializable
|
||
|
{
|
||
|
public uint NetworkId = 0;
|
||
|
public T Data = default!;
|
||
|
|
||
|
public void Deserialize(NetDataReader reader)
|
||
|
{
|
||
|
NetworkId = reader.GetUInt();
|
||
|
}
|
||
|
|
||
|
public void Serialize(NetDataWriter writer)
|
||
|
{
|
||
|
writer.Put(NetworkId);
|
||
|
}
|
||
|
}
|