using System.Collections.Generic;
using UnityEngine;

public abstract class DataListManager<T> : SceneDataListManagerInterface<T>
{
    [SerializeField] protected List<T> Elements = new List<T>();
    [SerializeField] protected UIBaseManager<T> uiManager;

    /// <summary>
    /// Pass ref to global instance of class
    /// </summary>
    /// <param name="_uiManager"></param>
    public DataListManager<T> SetUiManager(ref UIBaseManager<T> _uiManager)
    {
        uiManager = _uiManager;

        return this;
    }
    
    public List<T> GetList()
    {
        return Elements;
    }

    public void SetList(List<T> _elements)
    {
        Elements = _elements;
    }

    public void ClearList()
    {
        Elements.Clear();
    }

    public abstract void AddElementToList(T newElement);

    public abstract void RemoveElementFromList(T element);
}