public override void CheckAndAddEmptyAddTarget(IEquippableItemIcon pickedEqpII)
 {
     if (this.IsEligibleForEmptyAddTargetAddition(pickedEqpII))
     {
         IEquipToolEquippedCarriedGearsIG eqpCGIG = thisEqpIITAM.GetRelevantEquippedCarriedGearsIG();
         eqpCGIG.AddEmptyAddTarget((pickedEqpII.GetEquippableItem()));
     }
 }
示例#2
0
    public void IsEligibleForQuickDrop_ThisItemIsStackable_ThisHasSameItemAsHoveredEqpII_ReturnsFalse()
    {
        IEquippableItemIconConstArg arg;
        TestEqpII testEqpII = CreateTestEqpII(out arg);
        IUIItem   item      = arg.item;

        item.IsStackable().Returns(true);
        IEquippableItemIcon hoveredEqpII = Substitute.For <IEquippableItemIcon>();
        IEquippableUIItem   hoveredItem  = Substitute.For <IEquippableUIItem>();

        hoveredEqpII.GetEquippableItem().Returns(hoveredItem);
        item.IsSameAs(hoveredItem).Returns(true);
        ((IEquippableIITAManager)arg.iiTAM).GetHoveredEqpII().Returns(hoveredEqpII);

        Assert.That(testEqpII.TestIsEligibleForQuickDrop(), Is.False);
    }
    public void CheckAndAddEmptyAddTarget_PickedEqpIIIsNotBowOrWear_RelevEqpCGIGDoesNotHaveSameItem_CallRelevEqpCGIGAddEmpty()
    {
        IEquipToolPanelConstArg     arg;
        EquipToolEquippedItemsPanel eqpItemsPanel = CreateEqpToolEqpItemsPanel(out arg);
        IEquippableItemIcon         pickedEqpII   = Substitute.For <IEquippableItemIcon>();

        pickedEqpII.IsBowOrWearItemIcon().Returns(false);
        IEquippableUIItem pickedEqpItem = Substitute.For <IEquippableUIItem>();

        pickedEqpII.GetEquippableItem().Returns(pickedEqpItem);
        IEquipToolEquippedCarriedGearsIG relevEqpCGIG = Substitute.For <IEquipToolEquippedCarriedGearsIG>();

        arg.eqpIITAM.GetRelevantEquippedCarriedGearsIG().Returns(relevEqpCGIG);
        relevEqpCGIG.GetItemIconFromItem(pickedEqpItem).Returns((IEquippableItemIcon)null);

        eqpItemsPanel.CheckAndAddEmptyAddTarget(pickedEqpII);

        relevEqpCGIG.Received(1).AddEmptyAddTarget(Arg.Any <IEquippableUIItem>());
    }
示例#4
0
    public void IsEligibleForHover_ThisIsInSourceIG_ThisIsNotEmpty_ThisDoesNotHaveSameItemAsPickedEqpII_ReturnsFalse()
    {
        IEquippableItemIconConstArg arg;
        TestEqpII           testEqpII   = CreateTestEqpII(out arg);
        IEquippableItemIcon pickedEqpII = Substitute.For <IEquippableItemIcon>();
        IIconGroup          thisIG      = Substitute.For <IIconGroup>();

        testEqpII.SetIconGroup(thisIG);
        pickedEqpII.GetIconGroup().Returns(thisIG);
        IEquippableUIItem pickedEqpItem = Substitute.For <IEquippableUIItem>();

        pickedEqpII.GetEquippableItem().Returns(pickedEqpItem);
        arg.item.IsSameAs(pickedEqpItem).Returns(false);
        IItemIconEmptinessStateEngine emptinessStateEngine = arg.emptinessStateEngine;

        emptinessStateEngine.IsEmpty().Returns(false);

        Assert.That(testEqpII.TestIsEligibleForHover(pickedEqpII), Is.False);
    }
 bool IsEligibleForEmptyAddTargetAddition(IEquippableItemIcon pickedEqpII)
 {
     if (pickedEqpII.IsBowOrWearItemIcon())
     {
         return(false);
     }
     else
     {
         IEquipToolEquippedCarriedGearsIG eqpCGIG = thisEqpIITAM.GetRelevantEquippedCarriedGearsIG();
         IEquippableItemIcon sameItemEqpII        = (IEquippableItemIcon)eqpCGIG.GetItemIconFromItem(pickedEqpII.GetEquippableItem());
         if (sameItemEqpII != null)
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
 }
        public override bool HasSameItem(IItemIcon other)
        {
            IEquippableItemIcon otherEqpII = (IEquippableItemIcon)other;

            return(this.HasSameItem(otherEqpII.GetEquippableItem()));
        }