mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-24 19:33:10 +00:00
fc754b346b
[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`
56 lines
1.8 KiB
C#
56 lines
1.8 KiB
C#
using System;
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
/// <summary>
|
|
/// Stores the possible evolution bounds for a parsed entity with respect to its origins and game traversal.
|
|
/// </summary>
|
|
public class EvolutionHistory
|
|
{
|
|
private static readonly EvoCriteria[] NONE = Array.Empty<EvoCriteria>();
|
|
public static readonly EvolutionHistory Empty = new(NONE, 0);
|
|
|
|
public EvoCriteria[] Gen1 = NONE;
|
|
public EvoCriteria[] Gen2 = NONE;
|
|
public EvoCriteria[] Gen3 = NONE;
|
|
public EvoCriteria[] Gen4 = NONE;
|
|
public EvoCriteria[] Gen5 = NONE;
|
|
public EvoCriteria[] Gen6 = NONE;
|
|
public EvoCriteria[] Gen7 = NONE;
|
|
public EvoCriteria[] Gen7b = NONE;
|
|
public EvoCriteria[] Gen8 = NONE;
|
|
|
|
public EvoCriteria[] Gen8a => Gen8; // future: separate field instead of copy
|
|
public EvoCriteria[] Gen8b => Gen8; // future: separate field instead of copy
|
|
|
|
public readonly int Length;
|
|
public readonly EvoCriteria[] FullChain;
|
|
|
|
public EvolutionHistory(EvoCriteria[] fullChain, int count)
|
|
{
|
|
FullChain = fullChain;
|
|
Length = count;
|
|
}
|
|
|
|
public ref EvoCriteria[] this[int index]
|
|
{
|
|
get
|
|
{
|
|
if (index == 1) return ref Gen1;
|
|
if (index == 2) return ref Gen2;
|
|
if (index == 3) return ref Gen3;
|
|
if (index == 4) return ref Gen4;
|
|
if (index == 5) return ref Gen5;
|
|
if (index == 6) return ref Gen6;
|
|
if (index == 7) return ref Gen7;
|
|
if (index == 8) return ref Gen8;
|
|
throw new ArgumentOutOfRangeException(nameof(index));
|
|
}
|
|
}
|
|
|
|
internal void Invalidate() => this[Length - 1] = NONE;
|
|
|
|
public bool HasVisitedSWSH => Gen8.Length != 0;
|
|
public bool HasVisitedPLA => Gen8a.Length != 0;
|
|
public bool HasVisitedBDSP => Gen8b.Length != 0;
|
|
}
|