Пример #1
0
    IEquippableUIItem CreateStubItemFromTempTypeAndEquippedness(System.Type tempType, bool isEquipped)
    {
        IEquippableUIItem item = Substitute.For <IEquippableUIItem>();

        if (tempType == typeof(IBowTemplate))
        {
            IBowTemplate bowTemp = Substitute.For <IBowTemplate>();
            item.GetItemTemplate().Returns(bowTemp);
        }
        else if (tempType == typeof(IWearTemplate))
        {
            IWearTemplate wearTemp = Substitute.For <IWearTemplate>();
            item.GetItemTemplate().Returns(wearTemp);
        }
        else
        {
            ICarriedGearTemplate carriedGearTemp = Substitute.For <ICarriedGearTemplate>();
            item.GetItemTemplate().Returns(carriedGearTemp);
        }
        if (isEquipped)
        {
            item.IsEquipped().Returns(true);
        }
        else
        {
            item.IsEquipped().Returns(false);
        }
        return(item);
    }
Пример #2
0
        public override bool HasItemSpace(IUIItem item)
        {
            CheckPassedIUIItemTypeValidity(item);
            IEquippableUIItem eqpItem  = item as IEquippableUIItem;           //safe
            IItemTemplate     itemTemp = eqpItem.GetItemTemplate();

            if (itemTemp is IBowTemplate && !eqpItem.IsEquipped())
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }