private void createBodies(Scenario scenario) { bodies = new Dictionary <string, CelestialBody>(); foreach (string bodyName in scenario.common) { var body = new CelestialBody(); body.AssignInitialValues(scenario.bodies[bodyName]); body.name = bodyName; centralBody = (centralBody != null && centralBody.mass > body.mass) ? centralBody : body; bodies[body.name] = body; } centralBody.isCentral = true; }