Example #1
0
        public override bool HasItemSpace(IUIItem item)
        {
            CheckPassedIUIItemTypeValidity(item);
            IEquippableUIItem eqpItem     = item as IEquippableUIItem;        //safe
            IItemTemplate     eqpItemTemp = eqpItem.GetItemTemplate();

            if (eqpItemTemp is ICarriedGearTemplate)
            {
                int maxEquippableQuantity = eqpItem.GetMaxEquippableQuantity();
                int equippedQuantity      = this.GetItemQuantity(eqpItem);
                int space = maxEquippableQuantity - equippedQuantity;
                return(space > 0);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
    IEquippableUIItem CreateItemWithMaxEqpQAndTemplate(int maxEqpQ, System.Type type)
    {
        IEquippableUIItem eqpItem = Substitute.For <IEquippableUIItem>();

        eqpItem.GetMaxEquippableQuantity().Returns(maxEqpQ);
        if (type == typeof(IBowTemplate))
        {
            eqpItem.GetItemTemplate().Returns(Substitute.For <IBowTemplate>());
        }
        else if (type == typeof(IWearTemplate))
        {
            eqpItem.GetItemTemplate().Returns(Substitute.For <IWearTemplate>());
        }
        else
        {
            eqpItem.GetItemTemplate().Returns(Substitute.For <ICarriedGearTemplate>());
        }
        return(eqpItem);
    }