/// <summary> /// Gets data from a slot. /// </summary> /// <param name="slot">Slot to retrieve from.</param> /// <returns>Operation succeeded or not via enum value.</returns> public PKM Get(ISlotInfo slot) { // Reading from a slot is always allowed. var pk = slot.Read(SAV); NotifySlotChanged(slot, SlotTouchType.Get, pk); return(pk); }
/// <summary> /// Swaps two slots. /// </summary> /// <param name="source">Source slot to be switched with <see cref="dest"/>.</param> /// <param name="dest">Destination slot to be switched with <see cref="source"/>.</param> /// <returns>Operation succeeded or not via enum value.</returns> public SlotTouchResult Swap(ISlotInfo source, ISlotInfo dest) { if (!source.CanWriteTo(SAV)) { return(SlotTouchResult.FailSource); } if (!dest.CanWriteTo(SAV)) { return(SlotTouchResult.FailDestination); } NotifySlotChanged(source, SlotTouchType.None, source.Read(SAV)); NotifySlotChanged(dest, SlotTouchType.Swap, dest.Read(SAV)); return(SlotTouchResult.Success); }
public PKM ReadCurrent() => Slot.Read(View.SAV);