private static List <PokemonType> GetTypes(EFPokemon pokemon) { return(pokemon .PokemonTypes .Select(x => new PokemonType(x.Slot, x.Type.ToNamedApiResource())) .ToList()); }
private static List <VersionGameIndex> GetGameIndices(EFPokemon pokemon) { return(pokemon .PokemonGameIndices .Select(x => new VersionGameIndex(x.GameIndex, x.Version.ToNamedApiResource())) .ToList()); }
private static List <PokemonStat> GetStats(EFPokemon pokemon) { return(pokemon .PokemonStats .Select(x => new PokemonStat(x.Stat.ToNamedApiResource(), x.Effort, x.BaseStat)) .ToList()); }
private static List <NamedAPIResource> GetForms(EFPokemon pokemon) { return(pokemon .PokemonForms .Select(x => x.ToNamedApiResource()) .ToList()); }
private static List <PokemonAbility> GetAbilities(EFPokemon pokemon) { return(pokemon .PokemonAbilities .Select(x => new PokemonAbility(x.IsHidden, x.Slot, x.Ability.ToNamedApiResource())) .ToList()); }
private static List <PokemonHeldItem> GetHeldItems(EFPokemon pokemon) { return(pokemon .PokemonItems .GroupBy(x => x.Item, (g, elements) => { var pokemonHeldItemVersions = elements .Select(z => new PokemonHeldItemVersion(z.Rarity, z.Version?.ToNamedApiResource())) .ToList(); return new PokemonHeldItem(g.ToNamedApiResource(), pokemonHeldItemVersions); }) .ToList()); }
private static List <PokemonMove> GetMoves(EFPokemon pokemon) { return(pokemon .PokemonMoves .GroupBy(x => x.Move, (g, elements) => new PokemonMove { Move = g.ToNamedApiResource(), VersionGroupDetails = elements .Select(z => new PokemonMoveVersion ( z.PokemonMoveMethod.ToNamedApiResource(), z.VersionGroup.ToNamedApiResource(), z.Level )) .ToList() }) .ToList()); }
//private PokemonSprites GetSprites(EFPokemon pokemon) //{ // return null; // //return new PokemonSprites // //{ // // FrontDefault = "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/1.png", // // FrontShiny = "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/1.png", // // FrontFemale = null, // // FrontShinyFemale = null, // // BackDefault = "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png", // // BackShiny = "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png", // // BackFemale = null, // // BackShinyFemale = null // //}; //} private static NamedAPIResource GetSpecies(EFPokemon pokemon) { return(pokemon .Species .ToNamedApiResource()); }
private static string GetLocationAreaEncounters(EFPokemon pokemon) { return(typeof(PokemonsController).RscUrl($"{pokemon.Id}/encounters")); }
internal static NamedAPIResource ToNamedApiResource(this EFPokemon src) => src.ToNamedApiResource <PokemonsController>();