PKHeX/PKHeX.Core/Legality/Evolutions/EvolutionSets/EvolutionSet7.cs
Kurt 7f6f7a7bad Misc simplifications
reduce nesting (evo.RequiresLevelUp is checked twice, only check once
and handle path)
compact some methods
seal some classes
add a little xmldoc to exposed members
2018-07-01 19:55:23 -07:00

27 lines
No EOL
833 B
C#

using System;
namespace PKHeX.Core
{
/// <summary>
/// Generation 7 Evolution Branch Entries
/// </summary>
public sealed class EvolutionSet7 : EvolutionSet
{
private const int SIZE = 8;
public EvolutionSet7(byte[] data)
{
PossibleEvolutions = new EvolutionMethod[data.Length / SIZE];
for (int i = 0; i < data.Length; i += SIZE)
{
PossibleEvolutions[i / SIZE] = new EvolutionMethod
{
Method = BitConverter.ToUInt16(data, i + 0),
Argument = BitConverter.ToUInt16(data, i + 2),
Species = BitConverter.ToUInt16(data, i + 4),
Form = (sbyte)data[i + 6],
Level = data[i + 7],
};
}
}
}
}