Esempio n. 1
0
        /// <summary>
        /// The object called when the create stars form is closed. Checks to see if we should update the listing
        /// </summary>
        /// <param name="sender">The sender object</param>
        /// <param name="e">The event arguments</param>
        private void createStars_Closed(object sender, EventArgs e)
        {
            if (this.createStarsFinished)
            {
                foreach (Star s in this.ourSystem.sysStars)
                {
                    object[] rowVal = new object[12];
                    rowVal[0]  = s.currMass;
                    rowVal[1]  = s.name;
                    rowVal[2]  = Star.getDescFromFlag(s.selfID);
                    rowVal[3]  = s.specType;
                    rowVal[4]  = Math.Round(s.currLumin, 4);
                    rowVal[5]  = s.effTemp;
                    rowVal[6]  = s.orbitalRadius;
                    rowVal[7]  = Star.descGasGiantFlag(s.gasGiantFlag);
                    rowVal[8]  = s.starColor;
                    rowVal[9]  = s.returnCurrentBranchDesc();
                    rowVal[10] = s.isFlareStar;
                    rowVal[11] = s.printOrbitalDetails();

                    starTable.Rows.Add(rowVal);
                }

                lblSysAge.Text  = this.ourSystem.sysAge + " GYr";
                lblSysName.Text = this.ourSystem.sysName;
            }
        }
Esempio n. 2
0
        public override string ToString()
        {
            String ret;
            String nL = Environment.NewLine + "    ";

            ret = this.name + " is a " + this.getStatusDesc() + " star with spectral type " + this.specType;
            ret = ret + nL + "This star has " + this.currMass + " solar masses, and a current luminosity of " + Math.Round(this.currLumin, OptionCont.numberOfDecimal);
            ret = ret + nL + "solar luminosities. It has a surface temperature of " + Math.Round(this.effTemp, OptionCont.numberOfDecimal) + "K.";
            ret = ret + nL + "This star's radius is " + Math.Round(this.getRadiusAU(), OptionCont.numberOfDecimal) + " AU.";
            ret = ret + nL + "Apparent Color : " + this.starColor;

            if (OptionCont.getVerboseOutput())
            {
                ret = ret + Environment.NewLine;
                ret = ret + nL + "Initial Luminosity: " + this.initLumin + " solar luminosities.";
                ret = ret + nL + "Initial Mass: " + this.initMass + " solar masses";
                ret = ret + nL + "Formation Zones: " + Star.innerRadius(this.initLumin, this.initMass) + " AU to " + Math.Round(Star.outerRadius(this.initMass), OptionCont.numberOfDecimal) + " AU";
                ret = ret + nL + "Snow Line: " + Math.Round(Star.snowLine(this.initLumin), OptionCont.numberOfDecimal) + " AU.";
            }

            ret = ret + Environment.NewLine;
            if (this.isFlareStar)
            {
                ret = ret + nL + "This star is a flare star.";
            }

            ret = ret + Environment.NewLine;

            if (OptionCont.getVerboseOutput())
            {
                ret = ret + nL + "Self ID: " + Star.getDescSelfFlag(this.selfID) + " and Parent ID: " + Star.getDescSelfFlag(this.parentID);
                ret = ret + nL;
            }

            //printing out age details
            ret = ret + nL + "Evolution Data";
            ret = ret + Environment.NewLine;

            if (this.evoLine.getGiantLimit() < 1000)
            {
                ret = ret + nL + "Main Sequence Ends: " + this.evoLine.getMainLimit() + " Gyr,";
                ret = ret + " Subgiant Ends: " + this.evoLine.getSubLimit() + " Gyr";
                ret = ret + nL + "Giant Stage Ends: " + this.evoLine.getGiantLimit() + " Gyr";

                if (this.starAge < this.evoLine.getMainLimit())
                {
                    ret = ret + nL + "This star will exit the main sequence phase in: " + (this.evoLine.getMainLimit() - this.starAge) + " Gyr";
                }
                if (this.starAge >= this.evoLine.getMainLimit() && this.starAge < this.evoLine.getSubLimit())
                {
                    ret = ret + nL + "This star will exit the subgiant phase in: " + (this.evoLine.getSubLimit() - this.starAge) + " Gyr";
                }
                if (this.starAge >= this.evoLine.getSubLimit() && this.starAge < this.evoLine.getGiantLimit())
                {
                    ret = ret + nL + "This star will exit the giant phase in: " + (this.evoLine.getGiantLimit() - this.starAge) + " Gyr";
                }
                if (this.starAge >= this.evoLine.getGiantLimit())
                {
                    ret = ret + nL + "This star has been a white dwarf for: " + (this.starAge - this.evoLine.getGiantLimit()) + " Gyr";
                }
            }

            else
            {
                ret = ret + nL + "This star will burn out sometime well after the galaxy disappears.";
            }

            if (this.selfID != Star.IS_PRIMARY)
            {
                ret = ret + Environment.NewLine;
                ret = ret + nL + "Orbital Details";
                ret = ret + nL + "This orbits " + this.parentName + " at " + this.orbitalRadius + " AU.";

                if (this.orbitalEccent > 0)
                {
                    ret = ret + nL + "Eccentricity: " + this.orbitalEccent + ".";
                    ret = ret + nL + "Periapsis: " + Orbital.getPeriapsis(this.orbitalEccent, this.orbitalRadius) + " AU and Apapasis: " + Orbital.getApapsis(this.orbitalEccent, this.orbitalRadius) + " AU.";
                }

                ret = ret + nL + "Orbital period is " + Math.Round(this.orbitalPeriod, 2) + " years (" + Math.Round(this.orbitalPeriod * 365.25, 2);
                ret = ret + " days)";
                ret = ret + nL + "This has a seperation of " + libStarGen.getSeperationStr(this.orbitalSep);
            }

            ret = ret + nL;
            ret = ret + nL + "Orbital Details";
            foreach (Satellite s in this.sysPlanets)
            {
                ret = ret + nL + s;
                ret = ret + nL;
            }
            ret = ret + nL;

            if (OptionCont.getVerboseOutput())
            {
                ret = ret + nL;
                ret = ret + nL + "Formation Zone Details";
                ret = ret + nL;
                foreach (forbiddenZone r in this.zonesOfInterest.forbiddenZones)
                {
                    ret = ret + nL + r;
                }
                ret = ret + nL;
                foreach (cleanZone r in this.zonesOfInterest.formationZones)
                {
                    ret = ret + nL + r;
                }
                ret = ret + nL;
                ret = ret + nL + "Gas Giant Flag: " + Star.descGasGiantFlag(this.gasGiantFlag);
                ret = ret + nL;
            }

            return(ret);
        }