using System.Collections.Generic;
using Darkmatter.Core.Contracts.Services.Camera;
using Darkmatter.Core.Enums.Services.Camera;

namespace Darkmatter.Services.Camera
{
    public class CameraService : ICameraService
    {
        private readonly Dictionary<CameraType, UnityEngine.Camera> _cameras = new();

        public void RegisterCamera(UnityEngine.Camera camera, CameraType type) => _cameras.Add(type, camera);

        public CameraService(Dictionary<CameraType, UnityEngine.Camera> cameras)
        {
            _cameras = cameras;
        }

        public UnityEngine.Camera GetCamera(CameraType type = CameraType.MainCamera)
        {
            return _cameras.GetValueOrDefault(type);
        }
    }
}