示例#1
0
        public static IOrbitingBody Generate(
            Distance orbitalDistance,
            short orbitNumber,
            string occupiedType,
            string orbitType,
            IStar parentStar,
            double combinedLuminosity)
        {
            var p = new Planet();

            p.Size     = SystemBodySizeGenerator.Generate(orbitNumber, parentStar.Classification);
            p.Diameter = PlanetDiameterGenerator.Generate(occupiedType, p.Size);
            p.Density  = DensityGenerator.Generate(orbitType);
            p.Mass     = PlanetMassGenerator.Generate(p.Diameter, p.Density);

            p.OrbitNumber       = orbitNumber;
            p.OrbitalDistance   = orbitalDistance;
            p.OrbitalPeriod     = OrbitalPeriodGenerator.Generate(parentStar, p);
            p.OrbitEccentricity = OrbitalEccentricityGenerator.Generate();
            p.OrbitFactor       = OrbitFactorGenerator.Generate(p);
            p.RotationPeriod    = RotationPeriodGenerator.Generate(parentStar.Mass, p.OrbitalDistance);
            p.AxialTilt         = AxialTiltGenerator.Generate();
            p.AxialTiltEffect   = TiltEffectGenerator.Generate(p.AxialTilt);

            p.Atmosphere             = AtmosphereGenerator.Generate(orbitType, p.Size);
            p.AtmosphereCode         = AtmosphereCodeGenerator.Generate(p.Atmosphere);
            p.Hydrographics          = HydrographicsGenerator.Generate(orbitType, p.Atmosphere, p.Size);
            p.MaxPopulation          = MaxPopulationGenerator.Generate(orbitNumber, orbitType, p.Size, p.Atmosphere, p.Hydrographics, parentStar.HabitableZone);
            p.EnergyAbsorptionFactor = EnergyAbsorptionGenerator.Generate(orbitType, p.Hydrographics, p.AtmosphereCode);
            p.GreenhouseFactor       = GreenhouseTables.GreenHouse[p.Atmosphere];

            if (SystemConstants.UseGaiaFactor &&
                p.MaxPopulation > 5)
            {
                p.EnergyAbsorptionFactor = GaiaFactorGenerator.Generate(combinedLuminosity, p.OrbitFactor, p.GreenhouseFactor, p.EnergyAbsorptionFactor);
            }

            p.MeanTemperature = MeanTemperatureGenerator.Generate(combinedLuminosity, p.OrbitFactor,
                                                                  p.EnergyAbsorptionFactor, p.GreenhouseFactor);

            p.Seasons = SeasonsGenerator.Generate(p.Size, p.AxialTilt, p.AxialTiltEffect, p.OrbitFactor,
                                                  p.MeanTemperature, combinedLuminosity, p.OrbitalDistance, p.RotationPeriod, p.Atmosphere);

            SatellitesGenerator.Generate(parentStar, p, combinedLuminosity);

            return(p);
        }
示例#2
0
        public static IOrbitingBody Generate(IStar parentStar, IStellarOrbitingBody parentBody, double combinedLuminosity)
        {
            Moon moon = new Moon();

            //Body Details
            moon.Size     = SatelliteSizeGenerator.Generate(parentBody.Size);
            moon.Density  = DensityGenerator.Generate(parentBody.OrbitType);
            moon.Diameter = PlanetDiameterGenerator.Generate(OccupiedTypes.World, moon.Size);
            moon.Mass     = PlanetMassGenerator.Generate(moon.Diameter, moon.Density);

            //Orbital
            moon.OrbitalDistance   = SatelliteOrbitDistanceGenerator.Generate(parentBody);
            moon.OrbitalPeriod     = OrbitalPeriodGenerator.Generate(parentBody, moon);
            moon.OrbitFactor       = OrbitFactorGenerator.Generate(parentBody);
            moon.OrbitEccentricity = OrbitalEccentricityGenerator.Generate();
            moon.RotationPeriod    = (4 * (DieRoll.Roll2D6() - 2)) + 5;
            moon.AxialTilt         = AxialTiltGenerator.Generate();
            moon.AxialTiltEffect   = TiltEffectGenerator.Generate(moon.AxialTilt);

            //Environmental
            moon.Atmosphere     = AtmosphereGenerator.Generate(parentBody.OrbitType, parentBody.Size);
            moon.AtmosphereCode = AtmosphereCodeGenerator.Generate(moon.Atmosphere);
            moon.Hydrographics  = HydrographicsGenerator.Generate(parentBody.OrbitType, moon.Size, moon.Atmosphere);
            moon.MaxPopulation  = MaxPopulationGenerator.Generate(parentBody.OrbitNumber, parentBody.OrbitType, moon.Size,
                                                                  moon.Atmosphere, moon.Hydrographics, parentStar.HabitableZone);
            moon.EnergyAbsorptionFactor = EnergyAbsorptionGenerator.Generate(parentBody.OrbitType, moon.Hydrographics, moon.AtmosphereCode);
            moon.GreenhouseFactor       = GreenhouseTables.GreenHouse[moon.Atmosphere];

            if (SystemConstants.UseGaiaFactor &&
                moon.MaxPopulation > 5)
            {
                moon.EnergyAbsorptionFactor = GaiaFactorGenerator.Generate(combinedLuminosity, moon.OrbitFactor, moon.GreenhouseFactor, moon.EnergyAbsorptionFactor);
            }

            moon.MeanTemperature = MeanTemperatureGenerator.Generate(combinedLuminosity, moon.OrbitFactor, moon.EnergyAbsorptionFactor, moon.GreenhouseFactor);

            moon.Seasons = SeasonsGenerator.Generate(moon.Size, moon.AxialTilt, moon.AxialTiltEffect, moon.OrbitFactor,
                                                     moon.MeanTemperature, combinedLuminosity, moon.OrbitalDistance, moon.RotationPeriod, moon.Atmosphere);

            return(moon);
        }
示例#3
0
        public static GasGiant Generate(Distance orbitalDistance, short orbitNumber, string occupiedType,
                                        string orbitType, IStar parentStar, double combinedLuminosity)
        {
            int size;

            var gasGiant = new GasGiant
            {
                OrbitalDistance = orbitalDistance,
                Density         = PlanetDensities.Low
            };

            if (DieRoll.Roll1D6() < 3)
            {
                //Small
                size = -1;
                gasGiant.Description = "Small";
            }
            else
            {
                //Large
                size = -2;
                gasGiant.Description = "Large";
            }

            gasGiant.Diameter          = PlanetDiameterGenerator.Generate(occupiedType, size);
            gasGiant.Mass              = PlanetMassGenerator.Generate(gasGiant.Diameter, gasGiant.Density);
            gasGiant.OrbitNumber       = orbitNumber;
            gasGiant.OrbitalDistance   = orbitalDistance;
            gasGiant.OrbitEccentricity = OrbitalEccentricityGenerator.Generate();

            gasGiant.OrbitalPeriod = OrbitalPeriodGenerator.Generate(parentStar, gasGiant);

            gasGiant.RotationPeriod  = RotationPeriodGenerator.Generate(parentStar.Mass, gasGiant.OrbitalDistance);
            gasGiant.AxialTilt       = AxialTiltGenerator.Generate();
            gasGiant.AxialTiltEffect = TiltEffectGenerator.Generate(gasGiant.AxialTilt);

            SatellitesGenerator.Generate(parentStar, gasGiant, combinedLuminosity);

            return(gasGiant);
        }