/// <summary> /// This function fills in the details of the star. /// </summary> /// <param name="s">The star to be filled in</param> /// <param name="ourDice">The dice object used</param> /// <param name="maxMass">Max mass of the system</param> /// <param name="sysName">The name of the system</param> public static void generateAStar(Star s, Dice ourDice, double maxMass, string sysName) { //check mass first - if unset, set it. if (s.currMass == 0) { if (s.orderID == Star.IS_PRIMARY) { s.updateMass(libStarGen.rollStellarMass(ourDice, s.orderID)); maxMass = s.currMass; } else s.updateMass(libStarGen.rollStellarMass(ourDice, s.orderID, maxMass)); } //if we are in the white dwarf branch, reroll mass. if (s.evoLine.findCurrentAgeGroup(s.starAge) == StarAgeLine.RET_COLLASPEDSTAR) s.updateMass(ourDice.rollInRange(0.9, 1.4),true); //set the generic name s.name = Star.genGenericName(sysName, s.orderID); //initalize the luminosity first, then update it given the current age, status and mass. s.setLumin(); s.currLumin = Star.getCurrLumin(s.evoLine, s.starAge, s.currMass); //determine the temperature s.effTemp = Star.getInitTemp(s.currMass); s.effTemp = Star.getCurrentTemp(s.evoLine, s.currLumin, s.starAge, s.currMass, ourDice); //DERIVED STATS: RADIUS, Spectral Type s.radius = Star.getRadius(s.currMass, s.effTemp, s.currLumin, s.evoLine.findCurrentAgeGroup(s.starAge)); s.setSpectralType(); s.starColor = Star.setColor(ourDice, s.effTemp); //set flare status. libStarGen.setFlareStatus(s, ourDice); //end this here. We will hand orbital mechanics elsewhere. }