23 lines
		
	
	
		
			447 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			447 B
		
	
	
	
		
			C#
		
	
	
	
	
	
using LiteNetLib.Utils;
 | 
						|
 | 
						|
using Engine.Core;
 | 
						|
 | 
						|
namespace Engine.Systems.Network.Packers;
 | 
						|
 | 
						|
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)
 | 
						|
    {
 | 
						|
        float x = reader.GetFloat();
 | 
						|
        float y = reader.GetFloat();
 | 
						|
 | 
						|
        return new Vector2D(x, y);
 | 
						|
    }
 | 
						|
}
 |