PKHeX/PKHeX.Core/Editing/PKM/LegalMoveSource.cs

27 lines
690 B
C#
Raw Normal View History

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>
{
public LegalMoveInfo Info { get; } = new();
public readonly ILegalMoveDisplaySource<T> Display;
public LegalMoveSource(ILegalMoveDisplaySource<T> display) => Display = display;
public void ReloadMoves(IReadOnlyList<int> moves)
{
if (!Info.ReloadMoves(moves))
return;
Display.ReloadMoves(Info);
}
public void ChangeMoveSource(IReadOnlyList<T> moves)
{
Display.ReloadMoves(moves);
}
}