mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 20:43:07 +00:00
fc754b346b
[Language Reference](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces) Updates all the files, one less level of indentation. Some small changes were made to API surfaces, renaming `PKM pkm` -> `PKM pk`, and `LegalityAnalysis.pkm` -> `LegalityAnalysis.Entity`
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
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 void Reset()
|
|
{
|
|
LeftMouseIsDown = DragDropInProgress = false;
|
|
CurrentPath = null;
|
|
Cursor = default;
|
|
}
|
|
|
|
public bool SameLocation => (Destination != null) && (Source?.Equals(Destination) ?? false);
|
|
|
|
private bool SourceIsParty => Source?.Slot is SlotInfoParty;
|
|
private bool DestinationIsParty => Destination?.Slot is SlotInfoParty;
|
|
|
|
/// <summary>
|
|
/// Used to indicate if the changes will alter the player's party data state.
|
|
/// </summary>
|
|
public bool DragIsParty => SourceIsParty || DestinationIsParty;
|
|
|
|
public bool DragIsSwap => Source is not null && Destination is not null;
|
|
}
|