public async Task Bulbasaur() { PokemonInfoTable pokeInfo = await ORASConfig.GameConfig.GetPokemonInfo(); TmsHms tmsHms = await ORASConfig.GameConfig.GetTmsHms(); PokemonInfo nullInfo = pokeInfo[0]; PokemonInfo bulbasaurInfo = pokeInfo[Species.Bulbasaur]; Assert.AreNotEqual(nullInfo, bulbasaurInfo, "Species info for Bulbasaur is the same as Null/Egg"); Assert.AreEqual(6.9, bulbasaurInfo.WeightKg, "Species weight for Bulbasaur doesn't match the Pokedex!"); Assert.AreEqual(0.7, bulbasaurInfo.HeightM, "Species height for Bulbasaur doesn't match the Pokedex!"); Assert.AreEqual(PokemonTypes.Grass, PokemonTypes.GetValueFrom(bulbasaurInfo.Types[0]), "Bulbasaur's primary type should be Grass!"); Assert.AreEqual(PokemonTypes.Poison, PokemonTypes.GetValueFrom(bulbasaurInfo.Types[1]), "Bulbasaur's secondary type should be Poison!"); TestContext.Out.WriteLine("Bulbasaur can learn the following TMs:"); foreach (var(_, tm) in bulbasaurInfo.TmHm .Select((b, i) => (b, i)) .Where(t => t.Item1)) { string type = tm >= tmsHms.TmIds.Length ? "HM" : "TM"; int num = (type == "HM") ? (tm - 100 + 1) : (tm + 1); TestContext.Out.WriteLine($"\t{type} {num}: {tmsHms.GetMove( tm ).Name}"); } }
public async Task SavePokemonInfo(PokemonInfoTable table) { var garcPokeInfo = await this.GetGarc(GarcNames.PokemonInfo); await this.SavePokemonInfo(table, garcPokeInfo); await this.SaveFile(garcPokeInfo); }
internal async Task SavePokemonInfo(PokemonInfoTable table, ReferencedGarc garcPokeInfo) { Assertions.AssertVersion(this.Version, table.GameVersion); var files = await garcPokeInfo.GetFiles(); files[garcPokeInfo.Garc.FileCount - 1] = table.Write(); await garcPokeInfo.SetFiles(files); }
public async Task <PokemonInfoTable> GetPokemonInfo(bool edited = false) { var table = new PokemonInfoTable(this.Version); var garcPersonal = await this.GetGarc(GarcNames.PokemonInfo, edited : edited); var data = await garcPersonal.GetFile(garcPersonal.Garc.FileCount - 1); table.Read(data); return(table); }