mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-18 08:23:12 +00:00
78ff441e8b
rearrange some logic for clearer function (extract some methods)
28 lines
862 B
C#
28 lines
862 B
C#
using System;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
/// <summary>
|
|
/// Invalid Encounter Data
|
|
/// </summary>
|
|
public sealed class EncounterInvalid : IEncounterable
|
|
{
|
|
public int Species { get; }
|
|
public int LevelMin { get; }
|
|
public int LevelMax { get; }
|
|
public bool EggEncounter { get; }
|
|
|
|
public string Name => "Invalid";
|
|
|
|
public EncounterInvalid(PKM pkm)
|
|
{
|
|
Species = pkm.Species;
|
|
LevelMin = pkm.Met_Level;
|
|
LevelMax = pkm.CurrentLevel;
|
|
EggEncounter = pkm.WasEgg;
|
|
}
|
|
|
|
public PKM ConvertToPKM(ITrainerInfo SAV) => ConvertToPKM(SAV, EncounterCriteria.Unrestricted);
|
|
public PKM ConvertToPKM(ITrainerInfo SAV, EncounterCriteria criteria) => throw new ArgumentException($"Cannot convert an {nameof(EncounterInvalid)} to PKM.");
|
|
}
|
|
}
|