mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-30 15:59:13 +00:00
41578132cf
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
26 lines
690 B
C#
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);
|
|
}
|
|
}
|