mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 05:48:44 +00:00
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.
24 lines
647 B
C#
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);
|
|
}
|
|
}
|