diff --git a/PKHeX.Core/Editing/Saves/Editors/EventOld/EventWorkspace.cs b/PKHeX.Core/Editing/Saves/Editors/EventOld/EventWorkspace.cs index a7955fcb4..83c2f8932 100644 --- a/PKHeX.Core/Editing/Saves/Editors/EventOld/EventWorkspace.cs +++ b/PKHeX.Core/Editing/Saves/Editors/EventOld/EventWorkspace.cs @@ -1,9 +1,9 @@ -using System; +using System; using static PKHeX.Core.GameVersion; namespace PKHeX.Core; -public sealed class EventWorkspace where TSave : IEventFlagArray, IEventWorkArray where TWork : unmanaged +public sealed class EventWorkspace where TSave : class, IEventFlagArray, IEventWorkArray where TWork : unmanaged { private readonly TSave SAV; public readonly bool[] Flags; diff --git a/PKHeX.Core/Editing/Saves/Editors/EventWork/Diff/EventWorkDiff.cs b/PKHeX.Core/Editing/Saves/Editors/EventWork/Diff/EventWorkDiff.cs index 491406899..58fdffd5c 100644 --- a/PKHeX.Core/Editing/Saves/Editors/EventWork/Diff/EventWorkDiff.cs +++ b/PKHeX.Core/Editing/Saves/Editors/EventWork/Diff/EventWorkDiff.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using static PKHeX.Core.EventWorkDiffCompatibility; @@ -9,7 +9,7 @@ namespace PKHeX.Core; /// /// Calculates differences in the Event Blocks between two . /// -public sealed class EventBlockDiff : IEventWorkDiff where T : IEventFlagArray, IEventWorkArray where T2 : unmanaged, IEquatable +public sealed class EventBlockDiff : IEventWorkDiff where T : class, IEventFlagArray, IEventWorkArray where T2 : unmanaged, IEquatable { public List SetFlags { get; } = new(); public List ClearedFlags { get; } = new(); diff --git a/PKHeX.Core/Editing/Saves/Slots/SlotViewInfo.cs b/PKHeX.Core/Editing/Saves/Slots/SlotViewInfo.cs index b2002c64e..456f3df59 100644 --- a/PKHeX.Core/Editing/Saves/Slots/SlotViewInfo.cs +++ b/PKHeX.Core/Editing/Saves/Slots/SlotViewInfo.cs @@ -6,7 +6,7 @@ namespace PKHeX.Core; /// Tuple containing data for a and the originating /// /// -public sealed class SlotViewInfo : IEquatable +public sealed class SlotViewInfo : IEquatable where T : class { public readonly ISlotInfo Slot; public readonly ISlotViewer View; diff --git a/PKHeX.Core/Legality/MoveListSuggest.cs b/PKHeX.Core/Legality/MoveListSuggest.cs index dd90a8d81..fb6fd7ca5 100644 --- a/PKHeX.Core/Legality/MoveListSuggest.cs +++ b/PKHeX.Core/Legality/MoveListSuggest.cs @@ -194,6 +194,7 @@ private static void GetSuggestedRelearnEgg(this IEncounterTemplate enc, ReadOnly private static void GetEggRelearnMoves(this IEncounterTemplate enc, ReadOnlySpan parse, PKM pk, Span moves) { + pk.GetRelearnMoves(moves); // Extract a list of the moves that should end up in the relearn move list. LoadRelearnFlagged(moves, parse, pk); diff --git a/PKHeX.Core/Legality/Verifiers/Ability/AbilityChangeRules.cs b/PKHeX.Core/Legality/Verifiers/Ability/AbilityChangeRules.cs index 768d0e197..4411858e2 100644 --- a/PKHeX.Core/Legality/Verifiers/Ability/AbilityChangeRules.cs +++ b/PKHeX.Core/Legality/Verifiers/Ability/AbilityChangeRules.cs @@ -105,7 +105,7 @@ public static bool IsAbilityPatchRevertPossible(EvolutionHistory evosAll, int ab private static bool IsCapsulePossible(EvoCriteria[] evos, TTable table) where TTable : IPersonalTable - where TInfo : IPersonalInfo, IPersonalAbility12 + where TInfo : class, IPersonalInfo, IPersonalAbility12 { for (int i = evos.Length - 1; i >= 0; i--) { @@ -119,7 +119,7 @@ public static bool IsAbilityPatchRevertPossible(EvolutionHistory evosAll, int ab private static bool IsPatchPossible(EvoCriteria[] evos, TTable table) where TTable : IPersonalTable - where TInfo : IPersonalInfo, IPersonalAbility12H + where TInfo : class, IPersonalInfo, IPersonalAbility12H { for (int i = evos.Length - 1; i >= 0; i--) { @@ -144,7 +144,7 @@ public static bool IsAbilityPatchRevertPossible(EvolutionHistory evosAll, int ab private static bool IsRevertPossible(EvoCriteria[] evos, TTable table, int abilityIndex) where TTable : IPersonalTable - where TInfo : IPersonalInfo, IPersonalAbility12H + where TInfo : class, IPersonalInfo, IPersonalAbility12H { bool revert = false; for (var i = evos.Length - 1; i >= 0; i--) diff --git a/PKHeX.Core/Saves/Substructures/Inventory/Pouch/InventoryPouch.cs b/PKHeX.Core/Saves/Substructures/Inventory/Pouch/InventoryPouch.cs index bdadc2b9f..aa8ff8a40 100644 --- a/PKHeX.Core/Saves/Substructures/Inventory/Pouch/InventoryPouch.cs +++ b/PKHeX.Core/Saves/Substructures/Inventory/Pouch/InventoryPouch.cs @@ -58,7 +58,7 @@ protected InventoryPouch(InventoryType type, ushort[] legal, int maxCount, int o public void SortByEmpty() => Array.Sort(Items, (x, y) => (x.Count == 0).CompareTo(y.Count == 0)); public void SortBy(Func selector) where TItem : InventoryItem where TCompare : IComparable => Array.Sort(Items, (x, y) => selector((TItem)x).CompareTo(selector((TItem)y))); - private static int Compare(int i1, int i2, IReadOnlyList n, bool rev) where TCompare : IComparable + private static int Compare(int i1, int i2, IReadOnlyList n, bool rev) where TCompare : class, IComparable { if (i1 == 0 || i1 >= n.Count) return 1; diff --git a/PKHeX.WinForms/Controls/Slots/SlotChangeInfo.cs b/PKHeX.WinForms/Controls/Slots/SlotChangeInfo.cs index 2a29564b5..8c99c8a1c 100644 --- a/PKHeX.WinForms/Controls/Slots/SlotChangeInfo.cs +++ b/PKHeX.WinForms/Controls/Slots/SlotChangeInfo.cs @@ -2,7 +2,7 @@ namespace PKHeX.WinForms.Controls; -public sealed class SlotChangeInfo where TCursor : class +public sealed class SlotChangeInfo where TCursor : class where TImageSource : class { public bool LeftMouseIsDown { get; set; } public bool DragDropInProgress { get; set; }