mirror of
https://github.com/kwsch/PKHeX
synced 2025-01-02 07:38:48 +00:00
03182ebd3d
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>
31 lines
941 B
C#
31 lines
941 B
C#
using System;
|
|
using static PKHeX.Core.EntityContext;
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// Logic for fetching a specific <see cref="ILearnGroup"/>.
|
|
/// </summary>
|
|
public static class LearnGroupUtil
|
|
{
|
|
public static ILearnGroup GetCurrentGroup(PKM pk) => GetCurrentGroup(pk.Context);
|
|
|
|
public static ILearnGroup GetCurrentGroup(EntityContext context) => context switch
|
|
{
|
|
Gen1 => LearnGroup1.Instance,
|
|
Gen2 => LearnGroup2.Instance,
|
|
Gen3 => LearnGroup3.Instance,
|
|
Gen4 => LearnGroup4.Instance,
|
|
Gen5 => LearnGroup5.Instance,
|
|
Gen6 => LearnGroup6.Instance,
|
|
Gen7 => LearnGroup7.Instance,
|
|
Gen8 => LearnGroup8.Instance,
|
|
Gen9 => LearnGroup9.Instance,
|
|
|
|
Gen7b => LearnGroup7b.Instance,
|
|
Gen8a => LearnGroup8a.Instance,
|
|
Gen8b => LearnGroup8b.Instance,
|
|
|
|
_ => throw new ArgumentOutOfRangeException(nameof(context), context, null),
|
|
};
|
|
}
|