Esempio n. 1
0
        public void AddStar(int selfId, int parent, int order)
        {
            if (Math.Abs(SysAge) < 0)
            {
                throw new Exception("This star system needs an age.");
            }

            //Set flags here.
            var curPos = SysStars.Count;

            if (selfId == Star.IsSecondary)
            {
                Star2Index = curPos;
            }

            if (selfId == Star.IsSeccomp)
            {
                SubCompanionStar2Index = curPos;
            }

            if (selfId == Star.IsTrinary)
            {
                Star3Index = curPos;
            }

            if (selfId == Star.IsTricomp)
            {
                SubCompanionStar3Index = curPos;
            }

            //add it now

            SysStars.Add(new Star(SysAge, parent, selfId, order, SysName));
        }
Esempio n. 2
0
 public void ResetSystem()
 {
     SysAge                 = 0.0;
     MaxMass                = 0.0;
     NumDwarfPlanets        = 0;
     HelioPause             = 0.0;
     SubCompanionStar2Index = 0;
     SubCompanionStar3Index = 0;
     Star2Index             = 0;
     Star3Index             = 0;
     SysStars.Clear();
     HabitableZones.Clear();
 }
Esempio n. 3
0
 public void AddStar(Star newStar)
 {
     SysStars.Add(newStar);
 }
Esempio n. 4
0
 /// <summary>
 ///     This counts the total number of planets in this solar system
 /// </summary>
 /// <returns>Returns an integer of the number of planets</returns>
 public int CountPlanets()
 {
     return(SysStars.Sum(t => t.SysPlanets.Count));
 }