using AlicizaX;
using Cysharp.Threading.Tasks;
using Fantasy.Network;
using Fantasy.Network.Interface;
using UnityEngine;
using UnityEngine.Scripting;

namespace AlicizaX.Network.Runtime
{
    [DisallowMultipleComponent]
    [AddComponentMenu("Game Framework/Network")]
    [Preserve]
    public sealed class NetworkComponent : MonoBehaviour
    {
        private INetworkModule _networkModule;

        [SerializeField] private int m_HeartInterval = 2000;

        private void Awake()
        {
            _networkModule = ModuleSystem.RegisterModule<INetworkModule,NetworkModule>();
            if (_networkModule == null)
            {
                Log.Error("Network Manager is invalid.");
                return;
            }

            _networkModule.SetHeartInterval(m_HeartInterval);
        }
    }
}
