Exemple #1
0
 /// <summary>
 ///     Copy constructor
 /// </summary>
 /// <param name="s">The StarAgeLine object being copied</param>
 public StarAgeLine(StarAgeLine s)
 {
     InitList();
     foreach (var d in s.Points)
     {
         Points.Add(d);
     }
 }
Exemple #2
0
 /// <summary>
 ///     Copy constructor
 /// </summary>
 /// <param name="s">The StarAgeLine object being copied</param>
 public StarAgeLine( StarAgeLine s )
 {
     InitList();
     foreach (var d in s.Points)
     {
         Points.Add(d);
     }
 }
Exemple #3
0
        /// <summary>
        ///     This updates the star to what the current should be given no alterations.
        /// </summary>
        /// <param name="ageL">the age line of the star</param>
        /// <param name="age">The age of the star</param>
        /// <param name="mass">The current mass of the star</param>
        /// <returns>The current lumonsity of the star</returns>
        public static double GetCurrLumin( StarAgeLine ageL, double age, double mass )
        {
            var ageGroup = ageL.FindCurrentAgeGroup(age);

            if (ageGroup == StarAgeLine.RetMainbranch && mass < .45) //if it's under .45 solar masses, it'll always be the minimum luminosity.
            {
                return GetMinLumin(mass);
            }
            if (ageGroup == StarAgeLine.RetMainbranch && mass >= .45) // now it's going to be somewhere between the minimum and maximum, given it's age.
            {
                return GetMinLumin(mass) + age / ageL.GetMainLimit() * ( GetMaxLumin(mass) - GetMinLumin(mass) );
            }
            if (ageGroup == StarAgeLine.RetSubbranch) //simply maxmium luminsoity
            {
                return GetMaxLumin(mass);
            }
            if (ageGroup == StarAgeLine.RetGiantbranch)
            {
                return GetMaxLumin(mass) * 10000; //IMPLEMENTED HOUSE RULE. Yeah. Uh.. Yeah.
            }
            if (ageGroup == StarAgeLine.RetCollaspedstar)
            {
                return 1611047115.0 * mass * Math.Pow(ageL.GetAgeFromCollapse(age) * 100000000, -7.0 / 5.0); //corrected from report.
            }

            return 0;
        }
Exemple #4
0
 /// <summary>
 ///     This updates the star to the current surface temperature given no alterations
 /// </summary>
 /// <param name="ageL">the age line of the star</param>
 /// <param name="lumin">The current luminosity of the star (used for White Dwarfs)</param>
 /// <param name="age">The age of the star</param>
 /// <param name="mass">The current mass of the star</param>
 /// <param name="ourDice">Ddice (due to randomization of the temperature)</param>
 /// <returns>The current temperature of the star</returns>
 public static double GetCurrentTemp( StarAgeLine ageL, double lumin, double age, double mass, Dice ourDice )
 {
     if (ageL.FindCurrentAgeGroup(age) == StarAgeLine.RetMainbranch)
     {
         return GetInitTemp(mass);
     }
     if (ageL.FindCurrentAgeGroup(age) == StarAgeLine.RetSubbranch)
     {
         return GetInitTemp(mass) - ageL.CalcWithInSubLimit(age) * ( GetInitTemp(mass) - 4800 );
     }
     if (ageL.FindCurrentAgeGroup(age) == StarAgeLine.RetGiantbranch)
     {
         return 3000 + ourDice.Rng(2, 6, -2) * 200;
     }
     return ageL.FindCurrentAgeGroup(age) == StarAgeLine.RetCollaspedstar ? Math.Pow(lumin / Math.Pow(GetRadius(mass, 0, lumin, StarAgeLine.RetCollaspedstar), 2) * ( 5.38937375 * Math.Pow(10, 26) ), 1.00 / 4) : 0;
 }
Exemple #5
0
 /// <summary>
 ///     Constructor given the age, parent, self and Order.
 /// </summary>
 /// <param name="age">Age of the star</param>
 /// <param name="parent">The star this belongs to (for a priamry star, put IsPrimary here)</param>
 /// <param name="self">The star's ID</param>
 /// <param name="order">Where is it in the system?</param>
 public Star( double age, int parent, int self, int order )
     : base(parent, self)
 {
     StarAge = age;
     OrbitalRadius = 0.0;
     GasGiantFlag = GasgiantNone;
     EvoLine = new StarAgeLine();
     OrderId = order;
     SysPlanets = new List<Satellite>();
 }
Exemple #6
0
 /// <summary>
 ///     A full constructor.
 /// </summary>
 /// <param name="age">The age of the star</param>
 /// <param name="parent">The parent this star belongs to. (IsPrimary for a primary star)</param>
 /// <param name="self">The ID of this star</param>
 /// <param name="order">Where the star is in the sequence</param>
 /// <param name="baseName">The name of the system</param>
 public Star( double age, int parent, int self, int order, string baseName )
     : base(parent, self)
 {
     StarAge = age;
     OrbitalRadius = 0.0;
     GasGiantFlag = GasgiantNone; //set to none automatically. We will set it correctly later.
     OrderId = order;
     Name = GenGenericName(baseName, order);
     EvoLine = new StarAgeLine();
     SysPlanets = new List<Satellite>();
 }
Exemple #7
0
 /// <summary>
 ///     Base constructor, given no details.
 /// </summary>
 /// <param name="parent">The parent this star belongs to. (IsPrimary for a primary star)</param>
 /// <param name="self">The ID of this star</param>
 public Star( int parent, int self )
     : base(parent, self)
 {
     OrbitalRadius = 0.0;
     GasGiantFlag = GasgiantNone; //set to none automatically. We will set it correctly later.
     EvoLine = new StarAgeLine();
     SysPlanets = new List<Satellite>();
 }