mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-25 03:43:16 +00:00
55c7bf9858
EvolutionSet was just an object that hides an array, with no logic was planning to use the EvolutionSet to do the evolution checks, but EvolutionTree was required to connect the evolution chains together
38 lines
No EOL
1.1 KiB
C#
38 lines
No EOL
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
/// <summary>
|
|
/// Generation 7 Evolution Branch Entries
|
|
/// </summary>
|
|
public static class EvolutionSet7
|
|
{
|
|
private const int SIZE = 8;
|
|
|
|
private static EvolutionMethod[] GetMethods(byte[] data)
|
|
{
|
|
var evos = new EvolutionMethod[data.Length / SIZE];
|
|
for (int i = 0; i < data.Length; i += SIZE)
|
|
{
|
|
evos[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],
|
|
};
|
|
}
|
|
return evos;
|
|
}
|
|
|
|
public static IReadOnlyList<EvolutionMethod[]> GetArray(IReadOnlyList<byte[]> data)
|
|
{
|
|
var evos = new EvolutionMethod[data.Count][];
|
|
for (int i = 0; i < evos.Length; i++)
|
|
evos[i] = GetMethods(data[i]);
|
|
return evos;
|
|
}
|
|
}
|
|
} |