using System.Runtime.InteropServices;
using UnityEngine;

namespace FastArena.Network.Packets
{
    [StructLayout(LayoutKind.Sequential)]
    internal readonly struct TransformUpdatePacket
    {
        internal readonly PacketHeader header;
        internal readonly int gameObjectId; 
        internal readonly Vector3 position;
        internal readonly Quaternion rotation;

        internal TransformUpdatePacket(int _gameObjectId, Transform transform)
        {
            header = new PacketHeader(PacketType.TransformUpdate);
            gameObjectId = _gameObjectId;
            position = transform.position;
            rotation = transform.rotation;
        }
    }
}