private void Warp(bool showMessage) { SolarData system = null; try { system = SolarData.CreateSystem(seedString); } catch (System.Exception e) { Debugger.LogException("Unable to jump to system!", e); ScreenMessages.PostScreenMessage("Warp Drive failed due to " + e.GetType() + "." + "\nPlease press Alt+F2 and copy and paste or send a screenshot of the debugger to the Warp Drive developers!" + "\nException Message: " + e.Message, 10.0f, ScreenMessageStyle.UPPER_CENTER); return; } Debugger.LogWarning("Created system " + system.name + " from string " + seedString + "."); if (showMessage) { ScreenMessages.PostScreenMessage("Warp Drive initialized. Traveling to the " + system.name + " system, at coordinates " + seedString + ".", 3.0f, ScreenMessageStyle.UPPER_CENTER); } if (seedString != AstroUtils.KERBIN_SYSTEM_COORDS) { Events ["JumpToKerbol"].active = true; } }
public PlanetData(CelestialBody planet, SolarData system, int id) { this.planetID = id; this.solarSystem = system; this.planet = planet; // From here we add our randomizers orbitRandomizer = new OrbitRandomizer(planet, this); geologicalRandomizer = new GeologicalRandomizer(planet, this); generalRandomizer = new GeneralRandomizer(planet, this); atmosphereRandomizer = new AtmosphereRandomizer(planet, this); foreach (PlanetRandomizer randomizer in allRandomizers) { randomizer.Cache(); } }
/// <summary> /// Creates a solar system from a seed. /// </summary> /// <returns>The newly-created system.</returns> /// <param name="seed">The seed to use.</param> public static SolarData CreateSystem(string seed) { SolarData solarSystem = null; if (solarSystems.ContainsKey(seed)) { solarSystem = solarSystems[seed]; solarSystem.ApplySystem(); } else if (seed != AstroUtils.KERBIN_SYSTEM_COORDS) { solarSystem = new SolarData(seed); } else { solarSystem = new SolarData(); } return(solarSystem); }