PKHeX/PKHeX.WinForms/Controls/Slots/SlotChangeInfo.cs
Kurt cce4707604
Enable nullable for winforms csproj (#3037)
Handle all warnings
obviously the usage of null! could potentially be avoided if the object init wasn't such garbage, but here we are with years of old junk and lack of abstraction in the GUI project
2020-10-18 11:02:39 -07:00

31 lines
No EOL
936 B
C#

using PKHeX.Core;
namespace PKHeX.WinForms.Controls
{
public sealed class SlotChangeInfo<TCursor, TImageSource> where TCursor : class
{
public bool LeftMouseIsDown { get; set; }
public bool DragDropInProgress { get; set; }
public TCursor? Cursor { get; set; }
public string? CurrentPath { get; set; }
public SlotViewInfo<TImageSource>? Source { get; set; }
public SlotViewInfo<TImageSource>? Destination { get; set; }
public SlotChangeInfo()
{
Reset();
}
public void Reset()
{
LeftMouseIsDown = DragDropInProgress = false;
CurrentPath = null;
Cursor = default;
}
public bool SameLocation => (Destination != null) && (Source?.Equals(Destination) ?? false);
public bool DragIsParty => Source?.Slot is SlotInfoParty || Destination?.Slot is SlotInfoParty;
}
}