using UnityEngine;

namespace Assets.Scripts.NohaMorte
{
    public class UserAgentPositionInitializer : MonoBehaviour
    {
        public static UserAgentPositionInitializer instance;

        [SerializeField]
        DomeSeat[] allSeats;

        [SerializeField]
        DomeSeat thisSeat;

        [SerializeField]
        Vector3 correspondingLocationForThisUserChair { get { return VerticalProjectionCalculator.CalculateProjectionPointOnDomeGivenXZ(thisSeat.XZPosition.x, thisSeat.XZPosition.y); } }

        [Header("Debug help")]
        [SerializeField]
        bool debugMode;

        [SerializeField]
        GameObject testPrefab;

        private void Awake()
        {
            if (instance != null & instance != this)
            { Destroy(instance.gameObject); }
            instance = this;
        }

        public Vector3 CalculateInitialPosition(int seatIndex)
        {
            thisSeat = allSeats[seatIndex];
            return correspondingLocationForThisUserChair;
        }


    }
}
