PKHeX/PKHeX.Core/PKM/Shared/IDynamaxLevel.cs
Kurt 723514e89c
Update 21.11.19 - Brilliant Diamond & Shining Pearl (#3289)
Big thanks to @SciresM @sora10pls @Lusamine @architdate @ReignOfComputer for testing and contributing code / test cases. Can't add co-authors from the PR menu :(

Builds will fail because azure pipelines not yet updated with net6.
2021-11-19 18:23:49 -08:00

26 lines
640 B
C#

using static PKHeX.Core.Species;
namespace PKHeX.Core
{
public interface IDynamaxLevel
{
byte DynamaxLevel { get; set; }
}
public static class DynamaxLevelExtensions
{
public static bool CanHaveDynamaxLevel(this IDynamaxLevel _, PKM pkm)
{
if (pkm.IsEgg)
return false;
if (pkm.BDSP)
return false;
return CanHaveDynamaxLevel(pkm.Species);
}
private static bool CanHaveDynamaxLevel(int species)
{
return species is not ((int)Zacian or (int)Zamazenta or (int)Eternatus);
}
}
}