using System;
using System.Threading;
using Cysharp.Threading.Tasks;
using UnityEngine;

namespace RebootKit.Engine.Foundation {
    public interface IService : IDisposable {
        UniTask OnInit(CancellationToken cancellationToken);
    }

    public abstract class ServiceMonoBehaviour : MonoBehaviour, IService {
        public abstract UniTask OnInit(CancellationToken cancellationToken);
        public abstract void Dispose();
    }

    public abstract class ServiceAsset<T> : ScriptableObject where T : IService {
        public abstract T Create();
    }

    public abstract class ServiceAsset : ServiceAsset<IService> {
    }
}