feat: added LiteNetLib networking integration

This commit is contained in:
2025-08-05 19:27:47 +03:00
parent 6631cae7b0
commit 1644a751bb
20 changed files with 747 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
using LiteNetLib.Utils;
using Syntriax.Engine.Core;
namespace Syntriax.Engine.Systems.Network;
internal static class AABBNetPacker
{
internal static void Write(NetDataWriter writer, AABB data)
{
Vector2DNetPacker.Write(writer, data.LowerBoundary);
Vector2DNetPacker.Write(writer, data.UpperBoundary);
}
internal static AABB Read(NetDataReader reader)
{
Vector2D lowerBoundary = Vector2DNetPacker.Read(reader);
Vector2D upperBoundary = Vector2DNetPacker.Read(reader);
return new AABB(lowerBoundary, upperBoundary);
}
}