using System.Collections.Generic;
using Darkmatter.Core.Contracts.Services.Camera;
using Darkmatter.Libs.Installers;
using UnityEngine;
using VContainer;
using CameraType = Darkmatter.Core.Enums.Services.Camera.CameraType;

namespace Darkmatter.Services.Camera.Installers
{
    public class CameraModule : MonoBehaviour, IModule
    {
        [SerializeField] private UnityEngine.Camera mainCamera;
        [SerializeField] private UnityEngine.Camera uiCamera;
        [SerializeField] private UnityEngine.Camera captureCamera;

        public void Register(IContainerBuilder builder)
        {
            var cameras = new Dictionary<CameraType, UnityEngine.Camera>
            {
                { CameraType.MainCamera, mainCamera },
                { CameraType.UICamera, uiCamera },
                { CameraType.CaptureCamera, captureCamera }
            };
            builder.Register<ICameraService, CameraService>(Lifetime.Singleton).WithParameter(cameras);
        }
    }
}