using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[System.Serializable]
public class EquipmentSlot : ItemSlot
{

    [SerializeField] public EquipmentPanelSlotsTypeEnum type;

    public EquipmentTypeEnum EquipmentType;
    
    public override bool CanReceiveItem(Item item)
    {
        if(item == null)    // if dropped item is null alway accept :D
            return true;

        EquippableItem equippableItem = item as EquippableItem;  // jeśli item pierwotnie nie był typu EquippableItem to casting zwróci NULL

        return equippableItem != null && equippableItem.EquipmentType != EquipmentTypeEnum.None && equippableItem.EquipmentType == EquipmentType; // the second condition is to put items on fields with matched type
    }
}