mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-03 09:19:13 +00:00
164a26e757
SlotChangeManager is pretty glue-y, might eventually shift to this implementation
31 lines
No EOL
947 B
C#
31 lines
No EOL
947 B
C#
namespace PKHeX.Core
|
|
{
|
|
public class SlotChange : StorageSlotOffset
|
|
{
|
|
/// <summary> Parent of the object that initiated the slot change. </summary>
|
|
public object Parent { get; set; }
|
|
|
|
/// <summary> Original Data of the slot. </summary>
|
|
public byte[] OriginalData { get; set; }
|
|
|
|
public int Slot { get; set; } = -1;
|
|
public int Box { get; set; } = -1;
|
|
public PKM PKM { get; set; }
|
|
|
|
public bool IsParty => IsPartyFormat;
|
|
public bool IsValid => Slot > -1 && (Box > -1 || IsParty);
|
|
public bool Editable { get; set; }
|
|
|
|
public SlotChange() { }
|
|
|
|
public SlotChange(SlotChange info, SaveFile sav)
|
|
{
|
|
Box = info.Box;
|
|
Slot = info.Slot;
|
|
Offset = info.Offset;
|
|
PKM = sav.GetStoredSlot(info.Offset);
|
|
}
|
|
|
|
public SlotChange GetInverseData(SaveFile sav) => new SlotChange(this, sav);
|
|
}
|
|
} |