Example #1
0
 /// <summary>
 /// Names all the planets. This makes sure planets are named before the moons.
 /// </summary>
 /// <param name="system">System.</param>
 public static void NamePlanets(SolarData system)
 {
     if (!planetaryBodies.ContainsKey(system.sunData.planetID))
     {
         return;
     }
     SortPlanetsByDistance();
     PlanetData[] planets = planetaryBodies [system.sunData.planetID];
     for (int i = 0; i < planets.Length; i++)
     {
         NameBody(planets [i], true);
     }
     planetaryBodies [system.sunData.planetID] = planets;
 }
Example #2
0
        /// <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, bool debug = false)
        {
            SolarData solarSystem = null;

            if (solarSystems.ContainsKey(seed))
            {
                solarSystem       = solarSystems [seed];
                solarSystem.debug = debug;
                solarSystem.ApplySystem();
            }
            else if (seed == AstroUtils.KERBIN_SYSTEM_COORDS &&
                     FindSun().name == KERBOL_NAME)
            {
                solarSystem = new SolarData();
            }
            else
            {
                solarSystem = new SolarData(seed, debug);
            }
            return(solarSystem);
        }