23 lines
536 B
C#
23 lines
536 B
C#
using LiteNetLib.Utils;
|
|
|
|
using Engine.Core;
|
|
|
|
namespace Engine.Systems.Network;
|
|
|
|
internal static class Ray2DNetPacker
|
|
{
|
|
internal static void Write(NetDataWriter writer, Ray2D data)
|
|
{
|
|
Vector2DNetPacker.Write(writer, data.Origin);
|
|
Vector2DNetPacker.Write(writer, data.Direction);
|
|
}
|
|
|
|
internal static Ray2D Read(NetDataReader reader)
|
|
{
|
|
Vector2D from = Vector2DNetPacker.Read(reader);
|
|
Vector2D direction = Vector2DNetPacker.Read(reader);
|
|
|
|
return new Ray2D(from, direction);
|
|
}
|
|
}
|