Ejemplo n.º 1
0
 public Galaxy(int id, string galaxyName, Star[] Stars) : this(id, galaxyName)
 {
     foreach (Star S in Stars)
     {
         _stars.Add(S.Name, S);
     }
     NotifyPropertyChanged("Stars");
 }
Ejemplo n.º 2
0
 public void Add(int id, Galaxy galaxy)
 {
     if (_galaxies == null)
     {
         _galaxies = new ObservableDictionary <int, Galaxy>();
     }
     OrbNullArgumentException(galaxy, "Galaxy");
     OrbIdDetectedArgumentException(_galaxies, id);
     OrbNameDetectedArgumentException(_galaxies, galaxy.Name);
     galaxy.Id = id;
     _galaxies.Add(id, galaxy);
     NotifyPropertyChanged("Galaxies");
 }
Ejemplo n.º 3
0
 public void AddPlanet(int id, Planet newPlanet)
 {
     if (_planets == null)
     {
         _planets = new ObservableDictionary <int, Planet>();
     }
     OrbNullArgumentException(newPlanet, "Planet");
     OrbIdDetectedArgumentException(_planets, id, "Планета");
     OrbNameDetectedArgumentException(_planets, newPlanet.Name, "Планета");
     newPlanet.Id = id;
     _planets.Add(id, newPlanet);
     newPlanet.OwnerOrb    = this;
     newPlanet.OwnerGalaxy = OwnerGalaxy;
     NotifyPropertyChanged("Planets");
 }