public Evolutions(byte[] data) { int Count = data.Length / 4; if (data.Length < 4 || data.Length % 4 != 0) { return; } Evos = new DexLevel[Count]; for (int i = 0; i < data.Length; i += 4) { Evos[i / 4] = new DexLevel { Species = BitConverter.ToUInt16(data, i), Level = BitConverter.ToUInt16(data, i + 2) }; } }
public Evolutions(byte[] data) { int Count = data.Length / 4; if (data.Length < 4 || data.Length % 4 != 0) return; Evos = new DexLevel[Count]; for (int i = 0; i < data.Length; i += 4) { Evos[i/4] = new DexLevel { Species = BitConverter.ToUInt16(data, i), Level = BitConverter.ToUInt16(data, i + 2) }; } }