예제 #1
0
    public static List <PKM> GetLivingDex(this ITrainerInfo tr, IEnumerable <int> speciesToGenerate, PKM blank)
    {
        var result   = new List <PKM>();
        var destType = blank.GetType();

        foreach (var s in speciesToGenerate)
        {
            var pk = blank.Clone();
            pk.Species = s;
            pk.Gender  = pk.GetSaneGender();

            var pi = pk.PersonalInfo;
            for (int f = 0; f < pi.FormCount; f++)
            {
                var entry = tr.GetLivingEntry(pk, s, f, destType);
                if (entry == null)
                {
                    continue;
                }
                result.Add(entry);
            }
        }

        return(result);
    }