PKHeX/PKHeX.Core/Legality/Evolutions/EvolutionGroup/EvolutionGroupUtil.cs
Kurt 03182ebd3d Update 22.11.24
Adds support for Scarlet & Violet.

Co-Authored-By: SciresM <8676005+SciresM@users.noreply.github.com>
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2022-11-24 17:42:17 -08:00

28 lines
909 B
C#

using System;
using static PKHeX.Core.EntityContext;
namespace PKHeX.Core;
public static class EvolutionGroupUtil
{
public static IEvolutionGroup GetCurrentGroup(PKM pk) => GetCurrentGroup(pk.Context);
public static IEvolutionGroup GetCurrentGroup(EntityContext context) => context switch
{
Gen1 => EvolutionGroup1.Instance,
Gen2 => EvolutionGroup2.Instance,
Gen3 => EvolutionGroup3.Instance,
Gen4 => EvolutionGroup4.Instance,
Gen5 => EvolutionGroup5.Instance,
Gen6 => EvolutionGroup6.Instance,
Gen7 => EvolutionGroup7.Instance,
Gen8 => EvolutionGroup8.Instance,
Gen9 => EvolutionGroup9.Instance,
Gen7b => EvolutionGroup7b.Instance,
Gen8a => EvolutionGroup8.Instance,
Gen8b => EvolutionGroup8.Instance,
_ => throw new ArgumentOutOfRangeException(nameof(context), context, null),
};
}