/// <summary> /// Генерирует безжизненные планеты системы /// </summary> /// <param name="nameTemplate"> /// Имя звездной системы, в которой находятся генерируемые планеты /// </param> /// <param name="planetCount"> /// Счетчик планет системы /// </param> /// <param name="stars"> /// Коллекция <see cref="Star"/> системы /// </param> private static List <Planet> GetBarrenPlanets(string systemName, ref int planetCount, List <Star> stars) { int barrenCount = HelperRandomFunctions.GetRandomInt(minBarrenCount, maxBarrenCount + 1); LuminosityClass systemStarClass = stars[0].LumClass; List <Planet> planets = new List <Planet>(); TemperatureClass planetTemperature; if (systemStarClass == LuminosityClass.M || systemStarClass == LuminosityClass.K) { planetTemperature = TemperatureClass.Warm; } else { planetTemperature = TemperatureClass.Hot; } if (HelperRandomFunctions.PercentProbableBool(20) && barrenCount >= 1) { planets.Add(PlanetFactory.GetPlanet(GetPlanetName(systemName, planetCount), new PlanetType(planetTemperature, VolatilesClass.Airless, SubstancesClass.Ferria))); planetCount++; barrenCount--; if (HelperRandomFunctions.PercentProbableBool(20) && barrenCount >= 1) { planets.Add(PlanetFactory.GetPlanet(GetPlanetName(systemName, planetCount), new PlanetType(planetTemperature, VolatilesClass.Airless, SubstancesClass.Ferria))); planetCount++; barrenCount--; } } for (int index = 0; index < barrenCount; index++) { planets.Add(PlanetFactory.GetPlanet(GetPlanetName(systemName, planetCount), new PlanetType(planetTemperature, VolatilesClass.Airless, SubstancesClass.Terra))); planetCount++; } return(planets); }
private static double GasGiantRadiusGeneration() { double radius; if (HelperRandomFunctions.PercentProbableBool(10)) { radius = (double)HelperRandomFunctions.GetRandomInt(bigGasPlanetMinRadius, bigGasPlanetMaxRadius); } else if (HelperRandomFunctions.PercentProbableBool(20)) { radius = (double)HelperRandomFunctions.GetRandomInt(mediumGasPlanetMinRadius, bigGasPlanetMinRadius); } else { radius = (double)HelperRandomFunctions.GetRandomInt(smallGasPlanetMinRadius, mediumGasPlanetMinRadius); } return(radius); }
private static double RockyPlanetRadiusGeneration() { double radius; if (HelperRandomFunctions.PercentProbableBool(8)) { radius = (double)HelperRandomFunctions.GetRandomInt(bigPlanetMinRadius, bigPlanetMaxRadius); } else if (HelperRandomFunctions.PercentProbableBool(15)) { radius = (double)HelperRandomFunctions.GetRandomInt(mediumPlanetMinRadius, bigPlanetMinRadius); } else { radius = (double)HelperRandomFunctions.GetRandomInt(smallPlanetMinRadius, mediumPlanetMinRadius); } return(radius); }