2018-03-06 06:19:56 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
namespace PKHeX.Core
|
|
|
|
{
|
2018-07-21 03:22:46 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Levelup Learn Movepool Information
|
|
|
|
/// </summary>
|
2018-07-02 02:55:23 +00:00
|
|
|
public sealed class Learnset1 : Learnset
|
2018-03-06 06:19:56 +00:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
2018-08-03 03:11:42 +00:00
|
|
|
|
2018-03-06 06:19:56 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|