PKHeX/PKHeX.Core/Legality/Encounters/EncounterMisc/EncounterInvalid.cs
Kurt fc754b346b
File scoped namespaces (#3529)
[Language Reference](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces)

Updates all the files, one less level of indentation.

Some small changes were made to API surfaces, renaming `PKM pkm` -> `PKM pk`, and `LegalityAnalysis.pkm` -> `LegalityAnalysis.Entity`
2022-06-18 11:04:24 -07:00

44 lines
1.3 KiB
C#

using System;
namespace PKHeX.Core;
/// <summary>
/// Invalid Encounter Data
/// </summary>
public sealed record EncounterInvalid : IEncounterable
{
public static readonly EncounterInvalid Default = new();
public int Species { get; }
public int Form { get; }
public byte LevelMin { get; }
public byte LevelMax { get; }
public bool EggEncounter { get; }
public int Generation { get; }
public GameVersion Version { get; }
public bool IsShiny => false;
public Shiny Shiny => Shiny.Never;
public string Name => "Invalid";
public string LongName => "Invalid";
public int Location => 0;
public int EggLocation => 0;
public AbilityPermission Ability => AbilityPermission.Any12H;
public Ball FixedBall => Ball.None;
private EncounterInvalid() { }
public EncounterInvalid(PKM pk)
{
Species = pk.Species;
Form = pk.Form;
LevelMin = (byte)pk.Met_Level;
LevelMax = (byte)pk.CurrentLevel;
EggEncounter = pk.WasEgg;
Generation = pk.Generation;
Version = (GameVersion)pk.Version;
}
public PKM ConvertToPKM(ITrainerInfo tr) => ConvertToPKM(tr, EncounterCriteria.Unrestricted);
public PKM ConvertToPKM(ITrainerInfo tr, EncounterCriteria criteria) => throw new ArgumentException($"Cannot convert an {nameof(EncounterInvalid)} to PKM.");
}