using Assets.Scripts.Constants;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace Assets.Scripts.Managers
{
    public class WallsManager : MonoBehaviour
    {
        public static CameraAngle SwitchCameraAngle(CameraAngle cameraAngle, GameTime gameTime)
        {
            if (cameraAngle == CameraAngle.FrontAngle)
            {
                SetBackAngle(gameTime);
                return CameraAngle.BackAngle;
            }
            else
            {
                SetFrontAngle(gameTime);      
                return CameraAngle.FrontAngle;
            }
        }

        public static void SetCameraAngle(CameraAngle cameraAngle, GameTime gameTime = GameTime.Day)
        {
            if(cameraAngle == CameraAngle.FrontAngle)
            {
                SetFrontAngle(gameTime);
            }
            else
            {
                SetBackAngle(gameTime);
            }
        }

        public static void SetFrontAngle(GameTime gameTime)
        {
            if (gameTime != GameTime.Day)
                return;

            LayersManager.ShowLayer(Layers.FrontAngle);
            LayersManager.HideLayer(Layers.BackAngle);
        }

        public static void SetBackAngle(GameTime gameTime)
        {
            if (gameTime != GameTime.Day)
                return;

            LayersManager.ShowLayer(Layers.BackAngle);
            LayersManager.HideLayer(Layers.FrontAngle);
        }

        public static void HideAllWalls()
        {
            LayersManager.HideLayer(Layers.FrontAngle);
            LayersManager.HideLayer(Layers.BackAngle);
        }
    }
}
