Scriptum/Assets/Scripts/REFACTORING/Application/Shared/Manager/DataListManager.cs
2022-12-13 02:28:49 +01:00

39 lines
867 B
C#

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);
}