Pokemon-Go-Rocket-API
Pokemon-Go-Rocket-API copied to clipboard
Is there a way to get how many candys needed to evolve a pokemon?
Is there a way to get how many candys needed to evolve a pokemon by the API ?
Take a look at this implementation, namely at EvolveAllPokemonWithEnoughCandy:
var pokemonSettings = await GetPokemonSettings();
var settings = pokemonSettings.FirstOrDefault(x => x.PokemonId == pokemon.PokemonId);
var candy = pokemonCandy.FirstOrDefault(c => c.Candy.FamilyId == settings.FamilyId && c.Candy.Candy_ >= settings.CandyToEvolve);
/*...*/
public async Task<IEnumerable<PokemonSettings>> GetPokemonSettings()
{
var templates = await _client.Download.GetItemTemplates();
var pokeSettings = templates.ItemTemplates
.Select(i => i.PokemonSettings)
.Where(p => p != null && p.FamilyId != PokemonFamilyId.FamilyUnset)
.ToList();
return pokeSettings;
}