private EncounterSlot3[] ReadSwarmSlots(byte[] data) { const int size = 14; int count = (data.Length - 4) / size; var slots = new EncounterSlot3[count]; for (int i = 0; i < slots.Length; i++) { int offset = 4 + (size * i); int species = BitConverter.ToUInt16(data, offset + 0); // form always 0 int slotNum = data[offset + 3]; int min = data[offset + 4]; int max = data[offset + 5]; int[] moves = { BitConverter.ToUInt16(data, offset + 6), BitConverter.ToUInt16(data, offset + 8), BitConverter.ToUInt16(data, offset + 10), BitConverter.ToUInt16(data, offset + 12), }; slots[i] = new EncounterSlot3Swarm(this, species, min, max, slotNum, moves); } return(slots); }
private EncounterSlot3[] ReadRegularSlots(byte[] data) { const int size = 10; int count = (data.Length - 4) / size; var slots = new EncounterSlot3[count]; for (int i = 0; i < slots.Length; i++) { int offset = 4 + (size * i); int species = BitConverter.ToUInt16(data, offset + 0); int form = data[offset + 2]; int slotNum = data[offset + 3]; int min = data[offset + 4]; int max = data[offset + 5]; int mpi = data[offset + 6]; int mpc = data[offset + 7]; int sti = data[offset + 8]; int stc = data[offset + 9]; slots[i] = new EncounterSlot3(this, species, form, min, max, slotNum, mpi, mpc, sti, stc); } return(slots); }