Scriptum/Assets/Scripts/REFACTORING/Application/Shared/Manager/DataListManager.cs

34 lines
800 B
C#
Raw Permalink Normal View History

2022-10-22 18:04:21 +02:00
using System.Collections.Generic;
using UnityEngine;
public abstract class DataListManager<T> : SceneDataListManagerInterface<T>
{
2022-11-06 21:34:17 +01:00
[SerializeField] protected List<T> Elements = new List<T>();
2022-10-22 18:04:21 +02:00
[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;
}
2022-11-06 21:34:17 +01:00
public abstract void AddElementToList(T newElement);
public abstract void RemoveElementFromList(T element);
2022-10-22 18:04:21 +02:00
}