public void AddPlanet(double density, double radius, Vector position, Vector speed)
        {
            Planet planet = new Planet(density, radius, position, speed);

            Planets.Add(planet);
            SpaceObjects.Add(planet);
            canvas.Children.Add(planet.image);
        }
        public void AddAsteroid(double density, double radius, Vector position, Vector speed)
        {
            Asteroid asteroid = new Asteroid(density, radius, position, speed);

            Asteroids.Add(asteroid);
            SpaceObjects.Add(asteroid);
            canvas.Children.Add(asteroid.image);
        }
Пример #3
0
 public static void AddToSpaceObjects(SpaceObject so)
 {
     if (!SpaceObjects.Exists(x => x.Name == so.Name))
     {
         SpaceObjects.Add(so);
         OnSpaceObjectsItemsChanged();
     }
 }