PKHeX/PKHeX.Core/Legality/Structures/IMasteryInitialMoveShop8.cs
Kurt 5bdc6b9ef8
Privatize some static fields, more robust legal helper classes. (#3865)
* Uses LearnSource more throughout the codebase when appropriate, rather than loosely coupled pivot methods.
* Hides Learnset/EggMove data inside the LearnSource classes.
* Extracts functionality from the large Legal class & partial Table*.cs files into better performing helper classes.
* Cleans up some code from prior LearnSource commits.
2023-04-20 21:23:15 -07:00

25 lines
745 B
C#

using System;
namespace PKHeX.Core;
/// <summary>
/// Exposes permissions about the Move Shop
/// </summary>
public interface IMasteryInitialMoveShop8
{
(Learnset Learn, Learnset Mastery) GetLevelUpInfo();
void LoadInitialMoveset(PA8 pa8, Span<ushort> moves, Learnset learn, int level);
bool IsForcedMasteryCorrect(PKM pk);
void SetInitialMastery(PKM pk)
{
if (pk is PA8 pa8)
{
Span<ushort> moves = stackalloc ushort[4];
var level = pa8.Met_Level;
var (learn, mastery) = LearnSource8LA.GetLearnsetAndMastery(pk.Species, pk.Form);
LoadInitialMoveset(pa8, moves, learn, level);
pa8.SetEncounterMasteryFlags(moves, mastery, level);
}
}
}