mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-19 08:53:28 +00:00
ccf87242c1
struct implementing interface is boxed when passed to method that accepts interface (not generic method). Removes IDexLevel (no other inheritors but EvoCriteria) and uses the primitive the data is stored (array, not IReadOnlyList) for slightly better perf.
16 lines
516 B
C#
16 lines
516 B
C#
namespace PKHeX.Core;
|
|
|
|
public readonly record struct EvoCriteria
|
|
{
|
|
public ushort Species { get; init; }
|
|
public byte Form { get; init; }
|
|
public byte LevelUpRequired { get; init; }
|
|
public byte LevelMax { get; init; }
|
|
public byte LevelMin { get; init; }
|
|
|
|
public EvolutionType Method { get; init; }
|
|
|
|
public bool RequiresLvlUp => LevelUpRequired != 0;
|
|
|
|
public override string ToString() => $"{(Species) Species}{(Form != 0 ? $"-{Form}" : "")}}} [{LevelMin},{LevelMax}] via {Method}";
|
|
}
|