예제 #1
0
        public override void CheckAndRemoveEmptyEqpIIs()
        {
            IEquipToolEquipIG relevantEqpIG = thisEqpIITAM.GetRelevantEquipIG(thisEqpIITAM.GetPickedEqpII());

            if (relevantEqpIG is IEquipToolEquippedCarriedGearsIG)
            {
                relevantEqpIG.RemoveEmptyIIs();
            }
        }
    public void EvaluateHoverability_PickedTempIsCarriedGear_PickedEqpIIIsInPoolIG_PickedEqpIIIsNotEquipped_RelevantEqpIGSizeIsOne_CallsEngineBecomeHoverable()
    {
        IEquipToolPanelConstArg      arg;
        EquipToolEquippedItemsPanel  eqpItemsPanel = CreateEqpToolEqpItemsPanel(out arg);
        IEquippableItemIcon          pickedEqpII   = CreateStubEqpII(isBowOrWear: false, isInEqpIG: false, isEquipped: false);
        IPanelTransactionStateEngine mockEngine    = arg.panelTransactionStateEngine;
        IEquipToolEquipIG            relevantIG    = Substitute.For <IEquipToolEquipIG>();

        relevantIG.GetSize().Returns(1);
        arg.eqpIITAM.GetRelevantEquipIG(pickedEqpII).Returns(relevantIG);

        eqpItemsPanel.EvaluateHoverability(pickedEqpII);

        mockEngine.Received(1).BecomeHoverable();
    }
    public void CheckAndAddEmptyAddTarget_PickedEqpIIIsBowOrWear_DoesNotCallRelevEqpCGIGAddEmpty()
    {
        IEquipToolPanelConstArg     arg;
        EquipToolEquippedItemsPanel eqpItemsPanel = CreateEqpToolEqpItemsPanel(out arg);
        IEquippableItemIcon         pickedEqpII   = Substitute.For <IEquippableItemIcon>();

        pickedEqpII.IsBowOrWearItemIcon().Returns(true);
        IEquipToolEquipIG relevEqpCGIG = Substitute.For <IEquipToolEquipIG>();

        arg.eqpIITAM.GetRelevantEquippedCarriedGearsIG().Returns(relevEqpCGIG);

        eqpItemsPanel.CheckAndAddEmptyAddTarget(pickedEqpII);

        relevEqpCGIG.DidNotReceive().AddEmptyAddTarget(Arg.Any <IEquippableUIItem>());
    }
    public void HoverDefaultTransactionTargetEqpII_WhenCalled_CallsRelevEqpIGDefTATarEqpIICheckForHover()
    {
        IEquipToolPanelConstArg     arg;
        EquipToolEquippedItemsPanel eqpItemsPanel = CreateEqpToolEqpItemsPanel(out arg);
        IEquippableItemIcon         pickedEqpII   = Substitute.For <IEquippableItemIcon>();
        IEquipToolEquipIG           relevantIG    = Substitute.For <IEquipToolEquipIG>();
        IEquippableItemIcon         mockTarEqpII  = Substitute.For <IEquippableItemIcon>();

        relevantIG.GetDefaultTATargetEqpII(pickedEqpII).Returns(mockTarEqpII);
        arg.eqpIITAM.GetRelevantEquipIG(pickedEqpII).Returns(relevantIG);

        eqpItemsPanel.HoverDefaultTransactionTargetEqpII(pickedEqpII);

        mockTarEqpII.Received(1).CheckForHover();
    }
    public void ExcecuteTransaction_ThisEIIToEquipIsNotNull_ThisEIIToEquipIsSameAsPickedEqpII_CallsItImmigrateToRelevEqpIG()
    {
        IEqpIITAMConstArg   arg;
        TestEqpIITAM        testEqpIITAM = CreateTestEqpIITAM(out arg);
        IEquippableItemIcon eii          = Substitute.For <IEquippableItemIcon>();

        testEqpIITAM.SetEIIToEquip(eii);
        Assert.That(testEqpIITAM.GetEIIToEquip(), Is.SameAs(eii));
        testEqpIITAM.SetPickedII(eii);
        Assert.That(testEqpIITAM.GetPickedEqpII(), Is.SameAs(testEqpIITAM.GetEIIToEquip()));
        IEquipToolEquipIG eqpIG = arg.eqpToolIGManager.GetRelevantEquipIG(eii);

        testEqpIITAM.ExecuteTransaction();

        eii.Received(1).TravelTransfer(eqpIG);
    }
        public override List <IIconGroup> GetAllRelevantIGs(IItemIcon pickedII)
        {
            List <IIconGroup> result      = new List <IIconGroup>();
            IEquipToolPoolIG  relevPoolIG = GetRelevantPoolIG();

            result.Add(relevPoolIG);
            if (pickedII != null)
            {
                IEquipToolEquipIG relevEqpIG = GetRelevantEquipIG((IEquippableItemIcon)pickedII);
                result.Add(relevEqpIG);
            }
            else
            {
                List <IEquipToolEquipIG> allRelevantEqpIGs = GetAllRelevantEquipIGs();
                foreach (IEquipToolEquipIG eqpIG in allRelevantEqpIGs)
                {
                    result.Add(eqpIG);
                }
            }
            return(result);
        }