public void Generate() { // Manually create Sol if (Sol) { randomizeMoons = false; GenerateSol(); return; } // Make a single star with a single planet orbiting var myStar = new Orbital(OrbitalType.Star); AddOrbital(myStar); for (var i = 0; i < numberOfPlanets; i++) { var planet = new Planet(); if (randomizeMoons) { planet.GenerateRandomMoons(numberOfMoonsPerPlanet); } else { planet.Generate(numberOfMoonsPerPlanet); } myStar.AddOrbital(planet); } Debug.WriteLine("This solar system has:"); Debug.WriteLine(this.Orbitals.Count + " stars"); }
public Orbital Earth() { var earth = new Orbital(OrbitalType.Planet) { Mass = (float)5.97 * multiplierMass, Diameter = 12756, Density = 5514, Gravity = 9.8, RotationPeriod = 24, OrbitRadius = (ulong)149.6 * multiplierDistance, OrbitalPeriod = 365, OrbitalInitAngle = 338 }; var moon = new Orbital(OrbitalType.Moon) { Mass = (float)0.073 * multiplierMass, Diameter = 3475, Density = 3340, Gravity = 1.6, RotationPeriod = 708, OrbitRadius = (ulong)10.9 * multiplierDistance, OrbitalPeriod = 27, OrbitalInitAngle = 0 }; earth.AddOrbital(moon); return(earth); }
private void GenerateSol() { //https://nssdc.gsfc.nasa.gov/planetary/factsheet/index.html var sol = new Orbital(OrbitalType.Star); sol.AddOrbital(new Planet().Mercury()); sol.AddOrbital(new Planet().Venus()); sol.AddOrbital(new Planet().Earth()); sol.AddOrbital(new Planet().Mars()); sol.AddOrbital(new Planet().Jupiter()); sol.AddOrbital(new Planet().Saturn()); sol.AddOrbital(new Planet().Uranus()); sol.AddOrbital(new Planet().Neptune()); if (PlutoIsAPlanet) { sol.AddOrbital(new Planet().Pluto()); } AddOrbital(sol); }