using System.Collections.Generic; using System.Linq; using UnityEngine; public abstract class UISlotPanelManager : UIBaseManager { public virtual int SLOTS_NUMBER => 0; /// /// Function to find item in warehouser by its id, returns list of all slots where item occured /// /// /// public abstract List FindItemInWarehouse(int itemId); /// /// Function to find item in warehouser by its name, returns list of all slots where item occured /// /// /// public abstract List FindItemInWarehouseByName(string itemName); public abstract void RemoveByPosition(int keyPosition); public abstract int RemoveByItemId(int itemId); public abstract int RemoveByItemName(string itemName); public virtual void RemoveAll() { Elements.Clear(); } public bool IsFull() { return Elements.Count() == SLOTS_NUMBER; } protected bool CheckIfSlotIsInRange(int slotNumber) { return slotNumber < SLOTS_NUMBER; } protected abstract bool CheckIfSlotExists(int slotNumber); /// /// Check if slot is empty in local list /// /// protected abstract bool CheckIfPositionIsEmpty(int slotNumber); }