feat: engine data type packers

This commit is contained in:
2025-05-16 21:34:35 +03:00
parent 6591326b70
commit 03082ab43b
18 changed files with 361 additions and 9 deletions

View File

@@ -0,0 +1,22 @@
using LiteNetLib.Utils;
using Syntriax.Engine.Core;
namespace Syntriax.Engine.Network;
internal static class Vector2DNetPacker
{
internal static void Write(NetDataWriter writer, Vector2D data)
{
writer.Put(data.X);
writer.Put(data.Y);
}
internal static Vector2D Read(NetDataReader reader)
{
int x = reader.GetInt();
float y = reader.GetFloat();
return new Vector2D(x, y);
}
}