Standardize using FormRandomizer for all randomizers

This commit is contained in:
sora10pls
2020-06-27 14:59:59 -04:00
parent 4299e5d88b
commit 2e600b9080
10 changed files with 64 additions and 94 deletions

View File

@@ -10,14 +10,16 @@ public class EvolutionRandomizer : Randomizer
private readonly EvolutionSet[] Evolutions;
private readonly GameInfo Game;
private readonly PersonalTable Personal;
public readonly SpeciesRandomizer Randomizer;
public readonly SpeciesRandomizer RandSpec;
public readonly FormRandomizer RandForm;
public EvolutionRandomizer(GameInfo game, EvolutionSet[] evolutions, PersonalTable t)
{
Game = game;
Personal = t;
Evolutions = evolutions;
Randomizer = new SpeciesRandomizer(Game, t);
RandSpec = new SpeciesRandomizer(Game, t);
RandForm = new FormRandomizer(t);
}
public override void Execute()
@@ -44,8 +46,8 @@ private void Randomize(EvolutionSet evos, int species)
{
if (evo.Method != 0)
{
evo.Species = Randomizer.GetRandomSpecies(evo.Species, species);
evo.Form = Legal.GetRandomForme(evo.Species, false, true, Game.SWSH, Personal);
evo.Species = RandSpec.GetRandomSpecies(evo.Species, species);
evo.Form = RandForm.GetRandomForme(evo.Species, false, true, Game.SWSH, Personal.Table);
}
}
}