private void CreateRom(RandomizerDifficulty difficulty) { int parsedSeed; if (!int.TryParse(seedV11.Text, out parsedSeed)) { MessageBox.Show("Seed must be numeric or blank.", "Seed Error", MessageBoxButtons.OK, MessageBoxIcon.Error); WriteOutputV11("Seed must be numeric or blank."); } else { var romLocations = RomLocationsFactory.GetRomLocations(difficulty); RandomizerLog log = null; if (createSpoilerLog.Checked) { log = new RandomizerLog(string.Format(romLocations.SeedFileString, parsedSeed)); } seedV11.Text = string.Format(romLocations.SeedFileString, parsedSeed); var randomizerV11 = new RandomizerV11(parsedSeed, romLocations, log); randomizerV11.CreateRom(filenameV11.Text); var outputString = new StringBuilder(); outputString.AppendFormat("Done!{0}{0}{0}Seed: ", Environment.NewLine); outputString.AppendFormat(romLocations.SeedFileString, parsedSeed); outputString.AppendFormat(" ({0} Difficulty){1}{1}", romLocations.DifficultyName, Environment.NewLine); WriteOutputV11(outputString.ToString()); } }
private void CreateSpoilerLog(RandomizerDifficulty difficulty) { int parsedSeed; if (!int.TryParse(seedV11.Text, out parsedSeed)) { MessageBox.Show("Seed must be numeric or blank.", "Seed Error", MessageBoxButtons.OK, MessageBoxIcon.Error); WriteOutputV11("Seed must be numeric or blank."); } else { var romPlms = RomLocationsFactory.GetRomLocations(difficulty); RandomizerLog log = new RandomizerLog(string.Format(romPlms.SeedFileString, parsedSeed)); seedV11.Text = string.Format(romPlms.SeedFileString, parsedSeed); var randomizer = new RandomizerV11(parsedSeed, romPlms, log); WriteOutputV11(randomizer.CreateRom(filenameV11.Text, true)); } }