public Territory[] GeneratePlanets(Territory solarSystem, int count) { var planets = new List<Territory>(); for (var i = 0; i < count; i++) { var planetCategory = GalaxyCategoryEnum.GasPlanet; if (_random.Next(0, 2) == 1) { planetCategory = GalaxyCategoryEnum.WaterPlanet; } var newTerritory = new Territory(_professionCache, _personCache, solarSystem) { Name = _planetNames.OrderBy(_ => Guid.NewGuid()).First(), Category = planetCategory.ToString() }; planets.Add(newTerritory); if (planetCategory == GalaxyCategoryEnum.GasPlanet) { foreach (var station in GenerateSpaceStations(newTerritory, _random.Next(4, 10))) { newTerritory.AddTerritory(station); } } else { foreach (var territory in GenerateCountries(newTerritory, _random.Next(6, 15))) { newTerritory.AddTerritory(territory); } } } return planets.ToArray(); }
public Territory[] GenerateSolarSystems(Territory galaxy, int count) { // Just a sample solar system! var solSystem = new Territory(_professionCache, _personCache, galaxy) { Name = "Sol System", Category = GalaxyCategoryEnum.SolarSystem.ToString() }; foreach (var territory in GeneratePlanets(solSystem, _random.Next(4, 8))) { solSystem.AddTerritory(territory); } return new[] {solSystem}; }
public Territory GenerateGalaxy(int count = 1) { // We're just going to generate a sample galaxy with those code! var milkyWayGalaxy = new Territory(_professionCache, _personCache) { Name = "Milky Way Galaxy", Category = GalaxyCategoryEnum.Galaxy.ToString() }; foreach (var territory in GenerateSolarSystems(milkyWayGalaxy, 1)) { milkyWayGalaxy.AddTerritory(territory); } return milkyWayGalaxy; }