using Darkmatter.Core.Contracts.Services.Audio;
using Darkmatter.Core.Data.Static.Services.Audio;
using Darkmatter.Libs.Installers;
using UnityEngine;
using VContainer;
using VContainer.Unity;

namespace Darkmatter.Services.Audio
{
    public class AudioServiceModule : MonoBehaviour, IModule
    {
        [SerializeField] private SfxCatalogSO sfxCatalog;

        public void Register(IContainerBuilder builder)
        {
            if (sfxCatalog != null)
                builder.RegisterComponent(sfxCatalog);
            builder.Register<IAudioService, AudioService>(Lifetime.Singleton);
            builder.Register<ISfxPlayer, SfxPlayer>(Lifetime.Singleton);
        }
    }
}