Engine-Pong/Game/Network/Abstract/NetworkPacket.cs

22 lines
414 B
C#
Raw Normal View History

2024-07-15 17:00:04 +03:00
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);
}
}