public EvolutionSet6(byte[] data) { if (data.Length < SIZE || data.Length % SIZE != 0) { return; } int[] argEvos = { 6, 8, 16, 17, 18, 19, 20, 21, 22, 29, 30, 31, 32, 33, 34 }; PossibleEvolutions = new EvolutionMethod[data.Length / SIZE]; for (int i = 0; i < data.Length; i += SIZE) { PossibleEvolutions[i / SIZE] = new EvolutionMethod { Method = BitConverter.ToUInt16(data, i + 0), Argument = BitConverter.ToUInt16(data, i + 2), Species = BitConverter.ToUInt16(data, i + 4), // Copy Level = BitConverter.ToUInt16(data, i + 2), }; // Argument is used by both Level argument and Item/Move/etc. Clear if appropriate. if (argEvos.Contains(PossibleEvolutions[i / SIZE].Method)) { PossibleEvolutions[i / SIZE].Level = 0; } } }
public void Insert(EvolutionMethod entry) { int matchChain = -1; for (int i = 0; i < Chain.Count; i++) { if (Chain[i].StageEntryMethods.Any(e => e.Species == entry.Species)) { matchChain = i; } } if (matchChain != -1) { Chain[matchChain].StageEntryMethods.Add(entry); } else { Chain.Insert(0, new EvolutionStage { StageEntryMethods = new List <EvolutionMethod> { entry } }); } }
public void Insert(EvolutionMethod entry) { int matchChain = -1; for (int i = 0; i < Chain.Count; i++) if (Chain[i].StageEntryMethods.Any(e => e.Species == entry.Species)) matchChain = i; if (matchChain != -1) Chain[matchChain].StageEntryMethods.Add(entry); else Chain.Insert(0, new EvolutionStage { StageEntryMethods = new List<EvolutionMethod> {entry}}); }
public EvolutionSet7(byte[] data) { if (data.Length < SIZE || data.Length % SIZE != 0) { return; } PossibleEvolutions = new EvolutionMethod[data.Length / SIZE]; for (int i = 0; i < data.Length; i += SIZE) { PossibleEvolutions[i / SIZE] = new EvolutionMethod { Method = BitConverter.ToUInt16(data, i + 0), Argument = BitConverter.ToUInt16(data, i + 2), Species = BitConverter.ToUInt16(data, i + 4), Form = (sbyte)data[i + 6], Level = data[i + 7], }; } }
private int getIndex(EvolutionMethod evo) { int evolvesToSpecies = evo.Species; if (evolvesToSpecies == 0) { return(-1); } if (Personal == null) { return(evolvesToSpecies); } int evolvesToForm = evo.Form; if (evolvesToForm < 0) { evolvesToForm = 0; } return(Personal.getFormeIndex(evolvesToSpecies, evolvesToForm)); }
private int getIndex(EvolutionMethod evo) { int evolvesToSpecies = evo.Species; if (evolvesToSpecies == 0) return -1; if (Personal == null) return evolvesToSpecies; int evolvesToForm = evo.Form; if (evolvesToForm < 0) evolvesToForm = 0; return Personal.getFormeIndex(evolvesToSpecies, evolvesToForm); }
public EvolutionSet7(byte[] data) { if (data.Length < SIZE || data.Length % SIZE != 0) return; PossibleEvolutions = new EvolutionMethod[data.Length / SIZE]; for (int i = 0; i < data.Length; i += SIZE) { PossibleEvolutions[i / SIZE] = new EvolutionMethod { Method = BitConverter.ToUInt16(data, i + 0), Argument = BitConverter.ToUInt16(data, i + 2), Species = BitConverter.ToUInt16(data, i + 4), Form = (sbyte)data[i + 6], Level = data[i + 7], }; } }