Esempio n. 1
0
 private static List <PokemonType> GetTypes(EFPokemon pokemon)
 {
     return(pokemon
            .PokemonTypes
            .Select(x => new PokemonType(x.Slot, x.Type.ToNamedApiResource()))
            .ToList());
 }
Esempio n. 2
0
 private static List <VersionGameIndex> GetGameIndices(EFPokemon pokemon)
 {
     return(pokemon
            .PokemonGameIndices
            .Select(x => new VersionGameIndex(x.GameIndex, x.Version.ToNamedApiResource()))
            .ToList());
 }
Esempio n. 3
0
 private static List <PokemonStat> GetStats(EFPokemon pokemon)
 {
     return(pokemon
            .PokemonStats
            .Select(x => new PokemonStat(x.Stat.ToNamedApiResource(), x.Effort, x.BaseStat))
            .ToList());
 }
Esempio n. 4
0
 private static List <NamedAPIResource> GetForms(EFPokemon pokemon)
 {
     return(pokemon
            .PokemonForms
            .Select(x => x.ToNamedApiResource())
            .ToList());
 }
Esempio n. 5
0
 private static List <PokemonAbility> GetAbilities(EFPokemon pokemon)
 {
     return(pokemon
            .PokemonAbilities
            .Select(x => new PokemonAbility(x.IsHidden, x.Slot, x.Ability.ToNamedApiResource()))
            .ToList());
 }
Esempio n. 6
0
        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());
        }
Esempio n. 7
0
 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());
 }
Esempio n. 8
0
        //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());
        }
Esempio n. 9
0
 private static string GetLocationAreaEncounters(EFPokemon pokemon)
 {
     return(typeof(PokemonsController).RscUrl($"{pokemon.Id}/encounters"));
 }
Esempio n. 10
0
 internal static NamedAPIResource ToNamedApiResource(this EFPokemon src)
 => src.ToNamedApiResource <PokemonsController>();