public IEquippableItemIcon CreateStubEqpII(bool isBowOrWear, bool isInEqpIG, bool isEquipped) { IEquippableItemIcon eqpII = Substitute.For <IEquippableItemIcon>(); eqpII.IsBowOrWearItemIcon().Returns(isBowOrWear); eqpII.IsInEqpIG().Returns(isInEqpIG); eqpII.IsEquipped().Returns(isEquipped); return(eqpII); }
protected override bool IsEligibleForHover(IItemIcon pickedII) { if (pickedII is IEquippableItemIcon) { IEquippableItemIcon pickedEqpII = pickedII as IEquippableItemIcon; IUIItem pickedItem = pickedEqpII.GetUIItem(); IItemTemplate pickedItemTemp = pickedItem.GetItemTemplate(); if (pickedEqpII.IsBowOrWearItemIcon()) // always swapped { return(true); } else { if (pickedEqpII.IsInEqpIG()) { return(true); //always revertable } else // pickd from pool { if (pickedEqpII.IsEquipped()) //always has the same partially picked item { return(true); } else { IEquipToolIG relevantEqpIG = thisEqpIITAM.GetRelevantEquipIG(pickedEqpII); if (relevantEqpIG.GetSize() == 1) //swap target is deduced { return(true); } else { if (relevantEqpIG.HasSlotSpace()) //add target is deduced { return(true); } else { return(false); } } } } } } else { throw new System.ArgumentException("pickedII must be of type IEquippableItemIcon"); } }