Exemplo n.º 1
0
        private static List <(PBESpecies, PBEForm)> GetSpecies(PBESpecies species, PBEForm form)
        {
            // Recursion BAYBEE
            // IDK what to name these functions so enjoy Add1 and Add2
            var list = new List <(PBESpecies, PBEForm)>();

            void Add1(PBESpecies s, PBEForm f)
            {
                // Do not take forms if unable to change into them (Wormadam)
                if (PBEDataUtils.CanChangeForm(s, true))
                {
                    foreach (PBEForm cf in PBEDataUtils.GetForms(s, true))
                    {
                        Add2(s, cf);
                    }
                }
                else
                {
                    Add2(s, f);
                }
            }

            void Add2(PBESpecies s, PBEForm f)
            {
                foreach ((PBESpecies cs, PBEForm cf) in PBEDataProvider.Instance.GetPokemonData(s, f).PreEvolutions)
                {
                    Add1(cs, cf);
                }
                list.Add((s, f));
            }

            Add1(species, form);
            return(list);
        }