示例#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);
        }