mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-15 00:37:11 +00:00
7f6f7a7bad
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
33 lines
No EOL
870 B
C#
33 lines
No EOL
870 B
C#
using System.Collections.Generic;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
public sealed class Learnset1 : Learnset
|
|
{
|
|
private Learnset1(byte[] data, ref int offset)
|
|
{
|
|
var moves = new List<int>();
|
|
var levels = new List<int>();
|
|
while (data[offset] != 0)
|
|
{
|
|
levels.Add(data[offset++]);
|
|
moves.Add(data[offset++]);
|
|
}
|
|
++offset;
|
|
|
|
Moves = moves.ToArray();
|
|
Levels = levels.ToArray();
|
|
Count = Moves.Length;
|
|
}
|
|
public static Learnset[] GetArray(byte[] input, int maxSpecies)
|
|
{
|
|
var data = new Learnset[maxSpecies + 1];
|
|
|
|
int offset = 0;
|
|
for (int s = 0; s < data.Length; s++)
|
|
data[s] = new Learnset1(input, ref offset);
|
|
|
|
return data;
|
|
}
|
|
}
|
|
} |