Beispiel #1
0
        /// <summary>
        /// insert item into slot
        /// </summary>
        /// <param name="slot"></param>
        /// <param name="item"></param>
        /// <returns>if swap is successful, the old item.
        ///          if swap fails, the requested item.
        public BaseItem Equip(PaperdollSlot slot, BaseItem item)
        {

            if (!CanEquip(slot, item)) return item;

            // cache old item
            var oldItem = _equippedItems[slot];

            // swap it
            _equippedItems[slot] = item;

            return oldItem;
        }
Beispiel #2
0
 /// <summary>
 /// wrapper for Paperdoll
 /// </summary>
 /// <param name="slot"></param>
 /// <param name="item"></param>
 public BaseItem Equip(PaperdollSlot slot, BaseItem item)
 {
     return Paperdoll.Equip(slot, item);
 }
Beispiel #3
0
        public bool CanEquip(PaperdollSlot slot, BaseItem item)
        {
            // paperdoll doesn't support this slot
            if (!_slotRestrictions.IsBound(slot)) return false;

            // item doesn't fit in this slot
            if (_slotRestrictions[slot] != item.MyType) return false;

            return true;
        }