Remove unnecessary duplicate class

learn6 is same as learn7
This commit is contained in:
Kurt 2018-03-17 18:56:55 -07:00
parent 333b4bec2d
commit cfc8d136bf
3 changed files with 3 additions and 42 deletions

View File

@ -135,7 +135,7 @@ public void InitializeLearnset()
Learnsets = GARCLearnsets.Files.Select(file => new Learnset6(file)).ToArray();
break;
case 7:
Learnsets = GARCLearnsets.Files.Select(file => new Learnset7(file)).ToArray();
Learnsets = GARCLearnsets.Files.Select(file => new Learnset6(file)).ToArray();
break;
}
}

View File

@ -58,43 +58,4 @@ public override byte[] Write()
}
}
}
public class Learnset7 : Learnset
{
public Learnset7(byte[] data)
{
if (data.Length < 4 || data.Length % 4 != 0)
{ Count = 0; Levels = new int[0]; Moves = new int[0]; return; }
Count = data.Length / 4 - 1;
Moves = new int[Count];
Levels = new int[Count];
using (BinaryReader br = new BinaryReader(new MemoryStream(data)))
for (int i = 0; i < Count; i++)
{
Moves[i] = br.ReadInt16();
Levels[i] = br.ReadInt16();
}
}
public static Learnset[] getArray(byte[][] entries)
{
Learnset[] data = new Learnset[entries.Length];
for (int i = 0; i < data.Length; i++)
data[i] = new Learnset7(entries[i]);
return data;
}
public override byte[] Write()
{
Count = (ushort)Moves.Length;
using (MemoryStream ms = new MemoryStream())
using (BinaryWriter bw = new BinaryWriter(ms))
{
for (int i = 0; i < Count; i++)
{
bw.Write((short)Moves[i]);
bw.Write((short)Levels[i]);
}
bw.Write(-1);
return ms.ToArray();
}
}
}
}

View File

@ -88,7 +88,7 @@ private void getList()
dgv.Rows.Clear();
byte[] input = files[entry];
if (input.Length <= 4) { files[entry] = BitConverter.GetBytes(-1); return; }
pkm = new Learnset7(input);
pkm = new Learnset6(input);
dgv.Rows.Add(pkm.Count);
@ -132,7 +132,7 @@ private void changeEntry(object sender, EventArgs e)
private void B_RandAll_Click(object sender, EventArgs e)
{
setList();
var sets = files.Select(z => new Learnset7(z)).ToArray();
var sets = files.Select(z => new Learnset6(z)).ToArray();
var banned = new List<int>(new[] {165, 621, 464}.Concat(Legal.Z_Moves)); // Struggle, Hyperspace Fury, Dark Void
if (CHK_NoFixedDamage.Checked)
banned.AddRange(MoveRandomizer.FixedDamageMoves);