PKHeX/PKHeX.Core/Editing/PKM/LegalMoveSource.cs
Kurt 41578132cf Minor tweaks
Add Get/Set Relearn method to PKM.cs
Alpha Mastered move now indicates incomplete text entry (like moves/relearn)
Split up legal move indication helper class, use DI to allow other implementations of DataSource to be returned (pkhex mobile?).
Remove unused gender refresh method (see previous added UserControl commit)
Add helper method to center control within control
2022-05-02 18:11:31 -07:00

26 lines
690 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>
{
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);
}
}