using UnityEngine;
using System.Collections;

public class ChoiceScreenCaller
{
    public static ChoiceScreenCaller Instance { get; private set; }
    static ChoiceScreenCaller() { Instance = new ChoiceScreenCaller(); }

    private GameObject mCurrentlyOpenedLayer = null;

    public void Call(System.Type choiceScreenType)
    {
        mCurrentlyOpenedLayer = LayerManager.Instance.AddLayerOnTop(LayerManager.Layers.ChoiceScreen, true, new ChoiceScreenDatapack(choiceScreenType), false);
    }

    public void Dismiss()
    {
        if (mCurrentlyOpenedLayer != null)
        {
            LayerManager.Instance.RemoveLayer(mCurrentlyOpenedLayer, false, true);
        }
    }

    public bool GetLayerOpened()
    {
        return mCurrentlyOpenedLayer != null;
    }
}