Add test living dex generator

doesn't generate everything due to the evo chain not being 'full'
(instead is unevolved singular pkm), nor does it evolve pkm
This commit is contained in:
Kurt 2018-05-09 21:02:35 -07:00
parent 79b2576c31
commit 9fb7056837
2 changed files with 21 additions and 3 deletions

View file

@ -9,9 +9,8 @@ namespace PKHeX.Core
// EncounterEgg
public static IEnumerable<EncounterEgg> GenerateEggs(PKM pkm, bool all = false)
{
int tree = pkm.GenNumber;
var table = EvolutionTree.GetEvolutionTree(tree);
int maxSpeciesOrigin = GetMaxSpeciesOrigin(tree);
var table = EvolutionTree.GetEvolutionTree(pkm.Format);
int maxSpeciesOrigin = GetMaxSpeciesOrigin(pkm.GenNumber);
var evos = table.GetValidPreEvolutions(pkm, maxLevel: 100, maxSpeciesOrigin: maxSpeciesOrigin, skipChecks: true);
return GenerateEggs(pkm, evos, all);
}

View file

@ -1205,5 +1205,24 @@ namespace PKHeX.WinForms.Controls
ResetParty();
}
private void GenerateLivingDex()
{
var bd = SAV.BoxData;
var tr = SAV;
for (int i = 1; i <= 807; i++)
{
var pk = SAV.BlankPKM;
pk.Species = i;
pk.Gender = pk.GetSaneGender();
if (i == 678)
pk.AltForm = pk.Gender;
var f = EncounterMovesetGenerator.GeneratePKMs(pk, tr).FirstOrDefault();
if (f != null)
bd[i] = PKMConverter.ConvertToType(f, SAV.PKMType, out _);
}
SAV.BoxData = bd;
ReloadSlots();
}
}
}