﻿namespace AsmodeeDigital.Common.Plugin.Manager.Scene
{
    /// <summary>
    /// Abstract manager for loading scenes
    /// </summary>
    public class SceneManager
    {
        /// <summary>
        /// Instance of implementation of ISceneManager
        /// </summary>
        private static ISceneManager _internalSceneManager;

        /// <summary>
        /// Initialize the scene manager with an implementation of ISceneManager
        /// </summary>
        /// <param name="internalSceneManager">Implementation of ISceneManager</param>
        public static void Init(ISceneManager internalSceneManager)
        {
            SceneManager._internalSceneManager = internalSceneManager;
        }

        /// <summary>
        /// Load the scene. The new scene replace the old one
        /// </summary>
        /// <param name="sceneName">Scene name</param>
        public static void LoadScene(string sceneName)
        {
            _internalSceneManager.LoadScene(sceneName);
        }

        /// <summary>
        /// Check if the current scene has the same name as the one in parameter
        /// </summary>
        /// <param name="sceneName">Scene name</param>
        /// <returns></returns>
        public static bool IsCurrentScene(string sceneName)
        {
            return _internalSceneManager.IsCurrentScene(sceneName);
        }
    }
}
