private StellarSystem GenerateMultiStarSystem(StellarSystem parent, int position) { var countStars = RandomCalculator.SelectByWeight(_multiStarCountOccurrences); var system = new MultiObjectSystem(parent); for (var i = 0; i < countStars; i++) { var starSystem = GenerateSingleStarSystem(system, position); system.CenterSystems.Add(starSystem); } return(system); }
private List <StellarSystem> GenerateCenter(StellarSystem parent, int position) { var center = new List <StellarSystem>(); var starsToCreate = RandomCalculator.SelectByWeight(_starOccurrences); for (var i = 0; i < starsToCreate; i++) { var isMultiSystem = RandomCalculator.SelectByWeight(_multiStarOccurrences); var system = GenerateCenter(parent, position, isMultiSystem); center.Add(system); } return(center); }
private List <StellarSystem> GenerateSatellites(StellarSystem parent, int position) { var satelliteSystems = new List <StellarSystem>(); var countSatellites = RandomCalculator.SelectByWeight(_satelliteOccurrences); for (var i = position; i <= countSatellites; i++) { var multiSatelliteCount = RandomCalculator.SelectByWeight(_multiSatelliteCountOccurrences); var satelliteSystem = GenerateSatelliteSystem(parent, position, multiSatelliteCount); satelliteSystems.Add(satelliteSystem); } return(satelliteSystems); }