示例#1
0
        /// <summary>
        /// Assign the slot by the passed source slot.
        /// </summary>
        /// <param name="source">Source.</param>
        public override bool Assign(Object source)
        {
            if (source is IUIItemSlot)
            {
                IUIItemSlot sourceSlot = source as IUIItemSlot;

                if (sourceSlot != null)
                {
                    // Check if the equipment type matches the target slot
                    if (!this.CheckEquipType(sourceSlot.GetItemInfo()))
                    {
                        return(false);
                    }

                    return(this.Assign(sourceSlot.GetItemInfo(), source));
                }
            }

            // Default
            return(false);
        }
示例#2
0
		/// <summary>
		/// Assign the slot by the passed source slot.
		/// </summary>
		/// <param name="source">Source.</param>
		public override bool Assign(Object source)
		{
			if (source is IUIItemSlot)
			{
                IUIItemSlot sourceSlot = source as IUIItemSlot;
				
				if (sourceSlot != null)
					return this.Assign(sourceSlot.GetItemInfo(), source);
			}
			
			// Default
			return false;
		}
示例#3
0
        // <summary>
        /// Performs a slot swap.
        /// </summary>
        /// <returns><c>true</c>, if slot swap was performed, <c>false</c> otherwise.</returns>
        /// <param name="sourceSlot">Source slot.</param>
        public override bool PerformSlotSwap(Object sourceObject)
        {
            // Get the source slot
            IUIItemSlot sourceSlot = (sourceObject as IUIItemSlot);

            // Get the source item info
            UIItemInfo sourceItemInfo = sourceSlot.GetItemInfo();

            // Assign the source slot by this slot
            bool assign1 = sourceSlot.Assign(this.GetItemInfo(), this);

            // Assign this slot by the source slot
            bool assign2 = this.Assign(sourceItemInfo, sourceObject);

            // Return the status
            return(assign1 && assign2);
        }