PKHeX/PKHeX.Core/Editing/PKM/LegalMoveSource.cs
Kurt d47bb1d297
Update .NET Runtime to .NET 8.0 (#4082)
With the new version of Visual Studio bringing C# 12, we can revise our logic for better readability as well as use new methods/APIs introduced in the .NET 8.0 BCL.
2023-12-03 20:13:20 -08:00

24 lines
647 B
C#

using System.Collections.Generic;
namespace PKHeX.Core;
/// <summary>
/// Legal Move information for a single <see cref="PKM"/>, for indicating if a move is legal or not.
/// </summary>
public sealed class LegalMoveSource<T>(ILegalMoveDisplaySource<T> Display)
{
public LegalMoveInfo Info { get; } = new();
public readonly ILegalMoveDisplaySource<T> Display = Display;
public void ReloadMoves(LegalityAnalysis source)
{
if (!Info.ReloadMoves(source))
return;
Display.ReloadMoves(Info);
}
public void ChangeMoveSource(IReadOnlyList<T> moves)
{
Display.ReloadMoves(moves);
}
}