private static void PopulateGen4Tutors() { var tutors = BinLinker.Unpack(Util.GetBinaryResource("tutors_g4.pkl"), "g4"); for (int i = 0; i < tutors.Length; i++) { HGSS[i].AddTypeTutors(tutors[i]); } }
private static void PopulateGen3Tutors() { // Update Gen3 data with Emerald's data, FR/LG is a subset of Emerald's compatibility. var machine = BinLinker.Unpack(Util.GetBinaryResource("hmtm_g3.pkl"), "g3"); var tutors = BinLinker.Unpack(Util.GetBinaryResource("tutors_g3.pkl"), "g3"); for (int i = 0; i <= Legal.MaxSpeciesID_3; i++) { E[i].AddTMHM(machine[i]); E[i].AddTypeTutors(tutors[i]); } }
static byte[][] unpack(string resource) => BinLinker.Unpack(get(resource), resource);
private static byte[][] Get(string resource, string ident) => BinLinker.Unpack(Util.GetBinaryResource($"encounter_{resource}.pkl"), ident);
private static EncounterArea1[] Get(string name, string ident, GameVersion game) => EncounterArea1.GetAreas(BinLinker.Unpack(Util.GetBinaryResource($"encounter_{name}.pkl"), ident), game);
/// <summary> /// Direct fetch for <see cref="EncounterArea"/> data; can also be used to fetch supplementary encounter streams. /// </summary> /// <param name="ident">Unpacking identification ASCII characters (first two bytes of binary)</param> /// <param name="resource">Resource name (will be prefixed with "encounter_"</param> /// <returns>Array of encounter areas</returns> internal static T[] GetEncounterTables8 <T>(string ident, string resource) where T : EncounterAreaSH, new() { byte[] mini = Util.GetBinaryResource($"encounter_{resource}.pkl"); return(EncounterAreaSH.GetArray <T>(BinLinker.Unpack(mini, ident))); }
private static byte[][] Unpack(string resource) => BinLinker.Unpack(Get(resource), resource);