public void RegisterUnequip(ItemClasses.Item item) { if (item != null) { increaseStrength(-item.GetValueFromAttribute(Attribute.Strength)); increaseIntellect(-item.GetValueFromAttribute(Attribute.Intellect)); increaseVitality(-item.GetValueFromAttribute(Attribute.Vitality)); } }
/// <summary> /// Updates the items with an array of new ones. /// </summary> /// <param name="items">The new items.</param> public void UpdateItems(Item[] items) { //Do not update items when dragging (avoids duplicating the dragged item's icon) if (DraggingItem) return; //Run through all slots and place the new item in it for (int i = 0; i < items.Length; i++) { slots [i].Place(items [i]); } }
/// <summary> /// Called when the user starts dragging an item from a slot /// </summary> /// <param name="fromSlot">The slot the user dragged from.</param> public void StartDrag(DragableSlot fromSlot) { //Only react to the drag if there's actually an item in the slot. if (fromSlot.Content != null) { DraggingItem = true; //Store previous content in a local variable draggedItem = fromSlot.Content; fromSlot.RemoveContent (); //And store the slot the user dragged from, in order to place items when ending the drag draggedFrom = fromSlot; } }
public void EquipRightClick(ItemClasses.Item item) { if (item == null) { return; } foreach (var slot in slots) { if (slot.slotType == item.Type) { slot.Place(item); break; } } }
public virtual void Equip(ItemClasses.Item item) { }