mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-28 06:50:23 +00:00
6164884700
all but egg exposed it; now, just make egg expose it and remove the unnecessary interface we still need to Set generation for non-eggs/mgift, so have a separate Settable interface for internal purposes.
37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
using System;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
/// <summary>
|
|
/// Invalid Encounter Data
|
|
/// </summary>
|
|
public sealed class EncounterInvalid : IEncounterable
|
|
{
|
|
public static readonly EncounterInvalid Default = new EncounterInvalid();
|
|
|
|
public int Species { get; }
|
|
public int Form { get; }
|
|
public int LevelMin { get; }
|
|
public int LevelMax { get; }
|
|
public bool EggEncounter { get; }
|
|
public int Generation { get; set; }
|
|
|
|
public string Name => "Invalid";
|
|
public string LongName => "Invalid";
|
|
|
|
private EncounterInvalid() { }
|
|
|
|
public EncounterInvalid(PKM pkm)
|
|
{
|
|
Species = pkm.Species;
|
|
Form = pkm.AltForm;
|
|
LevelMin = pkm.Met_Level;
|
|
LevelMax = pkm.CurrentLevel;
|
|
EggEncounter = pkm.WasEgg;
|
|
Generation = pkm.GenNumber;
|
|
}
|
|
|
|
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.");
|
|
}
|
|
}
|