Пример #1
0
        public virtual void UnattachSlot()
        {
            _subscribedSlot.IsActive = false;

            _subscribedSlot.OnChange -= UpdateComponent;

            _subscribedSlot.Unequip();

            _subscribedSlot       = null;
            _subscribedSlotIsNull = true;
            _isSunscribed         = false;
        }
Пример #2
0
        public virtual bool AttachSlot(IEquipmentSlot slot)
        {
            if (_isSunscribed)
            {
                return(false);
            }

            _subscribedSlot       = slot;
            _subscribedSlotIsNull = false;

            _subscribedSlot.Equip(_description);

            _subscribedSlot.OnChange += UpdateComponent;

            _subscribedSlot.IsActive = true;
            _isSunscribed            = true;

            return(true);
        }
Пример #3
0
 public static bool HasItemEquipped(this IEquipmentSlot <IItem> slot)
 {
     return(slot.SlottedItem != null);
 }