using System;
using Conjure.Input;
using Sirenix.OdinInspector;
using Obvious.Soap;
using UnityEngine;

namespace Conjure
{
    public class JoinUi : SerializedMonoBehaviour
    {
        [SerializeField, ReadOnly] private InputManagerServer inputManagerServer;
        [SerializeField, Required] private InputServerReference inputManagerGameobjectReference;
        [SerializeField, Required] private EventListenerNoParam OnUpdateEvent;

        private void Awake()
        {
            if (inputManagerGameobjectReference is null)
            {
                throw new NullReferenceException($"inputManagerGameobjectReference shouldn't be null on {transform.name}");
            }
            if (inputManagerGameobjectReference.Value is null)
            {
                throw new NullReferenceException($"inputManagerGameobjectReference shouldn't be null on {inputManagerGameobjectReference.name}");
            }
            inputManagerServer = inputManagerGameobjectReference.Value.GetComponent<InputManagerServer>();
            
            //OnUpdateEvent.OnEventRaised();
        }

        private void UpdateVisual()
        {
            
        }
    }
}