private static TriatsDto GenerateTriatsForPlanet(PlanetDto planet, int value) { var rand = new Random(value * Settings.Seed); var triats = new TriatsDto(); triats.Rocky = true; if (Calculate.CalculateIsPlanetGasGiant(planet.Mass, planet.Radius)) { triats.GasGiant = true; triats.Rocky = false; } else if (Calculate.CalculateIsPlanetHasDenseAtmosphere(Settings, planet.Mass, planet.MaxTemperature)) { triats.DenseAtmosphere = true; } else if (!Calculate.CalculateIsPlanetHasAtmosphere(Settings, planet.Mass, planet.MaxTemperature)) { triats.NoAtmosphere = true; } var number = rand.Next() % _modulo; if (triats.Rocky && !triats.NoAtmosphere && number < Settings.PlanetFriendlyAtmosphereChance) { triats.FriendlyAtmosphere = true; } number = rand.Next() % _modulo; if (triats.Rocky && !triats.NoAtmosphere && number < Settings.PlanetToxicAtmosphereChance) { triats.ToxicAtmosphere = true; } number = rand.Next() % _modulo; if (number < Settings.PlanetStrongRadiationChance) { triats.StrongRadiation = true; } number = rand.Next() % _modulo; if (triats.Rocky && number < Settings.PlanetHightVolcanicActivityChance) { triats.HightVolcanicActivity = true; } if ((planet.MinTemperature + planet.MaxTemperature) / 2 > Settings.PlanetHotTreshold) { triats.Hot = true; } else if ((planet.MinTemperature + planet.MaxTemperature) / 2 < Settings.PlanetColdTreshold) { triats.Cold = true; } return(triats); }
private static TriatsDto GenerateTriatsForMoon(MoonDto moon, int value) { var rand = new Random(value * Settings.Seed); var triats = new TriatsDto(); triats.Rocky = true; triats.NoAtmosphere = true; triats.Cold = true; var number = rand.Next() % _modulo; if (number < Settings.MoonStrongRadiationChance) { triats.StrongRadiation = true; } return(triats); }