namespace PKHeX.Core;
///
/// Logic for determining the hidden potential (overall IV grade) of a Pokémon.
///
public static class PowerPotential
{
///
/// Gets the Potential evaluation of the input .
///
public static int GetPotential(int ivTotal) => ivTotal switch
{
<= 90 => 0,
<= 120 => 1,
<= 150 => 2,
_ => 3,
};
private static string GetPotentialUnicode(int rating) => rating switch
{
0 => "★☆☆☆",
1 => "★★☆☆",
2 => "★★★☆",
_ => "★★★★",
};
private static string GetPotentialASCII(int rating) => rating switch
{
0 => "+",
1 => "++",
2 => "+++",
_ => "++++",
};
///
/// Gets the Potential evaluation of the input .
///
/// Pokémon to analyze.
/// Returned value is unicode or not
/// Potential string
public static string GetPotentialString(this PKM pk, bool unicode = true)
{
var rating = pk.PotentialRating;
if (unicode)
return GetPotentialUnicode(rating);
return GetPotentialASCII(rating);
}
}