public MainWindow() { InitializeComponent(); allObjects = new allSpaceObjects(); allObjects.allPlanets(); allObjects.allMoons(); list = allObjects.objectList; t = new System.Windows.Threading.DispatcherTimer(); t.Interval = new TimeSpan(2000); t.Tick += t_Tick; t.Start(); subscribePlanets(); }
public static void Main() { allSpaceObjects planets = new allSpaceObjects(); planets.allPlanets(); planets.allMoons(); List <SpaceObject> solarSystem = planets.objectList; foreach (SpaceObject obj in solarSystem) { obj.Draw(); if (obj.children.Count != 0) { Console.WriteLine(" Moons: "); foreach (SpaceObject child in obj.children) { child.Draw(); } } } Console.ReadLine(); }