PKHeX/PKHeX.Core/Legality/Encounters/EncounterMisc/EncounterRejected.cs
Kurt 6164884700 Merge IGeneration into IEncounterable
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.
2020-05-17 12:32:28 -07:00

32 lines
No EOL
1.2 KiB
C#

using System;
namespace PKHeX.Core
{
/// <summary>
/// Rejected Encounter Data containing a reason why the encounter was rejected (not compatible).
/// </summary>
public sealed class EncounterRejected : IEncounterable
{
public readonly IEncounterable Encounter;
public readonly CheckResult Check;
public string Reason => Check.Comment;
public int Species => Encounter.Species;
public int Form => Encounter.Form;
public string Name => Encounter.Name;
public string LongName => Encounter.LongName;
public bool EggEncounter => Encounter.EggEncounter;
public int LevelMin => Encounter.LevelMin;
public int LevelMax => Encounter.LevelMax;
public int Generation => Encounter.Generation;
public EncounterRejected(IEncounterable encounter, CheckResult check)
{
Encounter = encounter;
Check = check;
}
public PKM ConvertToPKM(ITrainerInfo SAV) => ConvertToPKM(SAV, EncounterCriteria.Unrestricted);
public PKM ConvertToPKM(ITrainerInfo SAV, EncounterCriteria criteria) => throw new ArgumentException($"Cannot convert an {nameof(EncounterRejected)} to PKM.");
}
}