19 lines
416 B
C#
19 lines
416 B
C#
using LiteNetLib;
|
|
using LiteNetLib.Utils;
|
|
|
|
using Syntriax.Engine.Core;
|
|
|
|
namespace Syntriax.Engine.Network;
|
|
|
|
public static class NetworkExtensions
|
|
{
|
|
public static Vector2D GetVector2D(this NetPacketReader reader)
|
|
=> new(reader.GetFloat(), reader.GetFloat());
|
|
|
|
public static void Put(this NetDataWriter writer, Vector2D vector)
|
|
{
|
|
writer.Put(vector.X);
|
|
writer.Put(vector.Y);
|
|
}
|
|
}
|