using System.Text;
using static PKHeX.Core.LearnMethod;
namespace PKHeX.Core;
///
/// Small struct that stores the where & how details a move can be learned.
///
/// How the move was learned
/// Where the move was learned
/// Conditions in which the move was learned
public readonly record struct MoveLearnInfo(LearnMethod Method, LearnEnvironment Environment, byte Argument = 0)
{
///
/// Summarizes the move learn info into a human-readable format and appends it to the provided .
///
/// The to append the summary to.
/// The localized strings to use for displaying the learning method.
public void Summarize(StringBuilder sb, MoveSourceLocalization strings)
{
var localizedMethod = strings.Localize(Method);
if (Environment.IsSpecified)
sb.Append(Environment).Append('-');
sb.Append(localizedMethod);
if (Method is LevelUp)
sb.AppendFormat(strings.LevelUpSuffix, Argument);
}
}