public City GenerateCity(string id) { City city = entityManager.GetCity(id); SetCityPopulation(city, settings.CityPopulationMin, settings.CityPopulationMax); city.CultureId = entityManager.GetCultureIds().GetRandomElement(rng.Randomiser); city.ReligionId = entityManager.GetReligionIds().GetRandomElement(rng.Randomiser); city.CivilizationLevel = rng.Get(settings.CityBarbarianLevelMin, settings.CityCivilisationLevelMax); city.BarbarianLevel = rng.Get(settings.CityBarbarianLevelMin, settings.CityBarbarianLevelMax); return(city); }
public Country GenerateCountry(string capitalCityId) { City capital = entityManager.GetCity(capitalCityId); Country country = new Country(); country.Id = GenerateCountryId(capital.NameId); country.Name = capital.NameId; country.CultureId = capital.CultureId; country.ReligionId = capital.ReligionId; country.GovernmentId = entityManager.GetGovernmentIds().GetRandomElement(rng.Randomiser); country.DiplomaticStanceId = entityManager.GetDiplomaticStanceIds().GetRandomElement(rng.Randomiser); country.CentralisationLevel = rng.Get(settings.CountryCentralisationLevelMin, settings.CountryCentralisationLevelMax); country.CapitalId = capital.Id; country.ColourRed = rng.Get(0, 255); country.ColourGreen = rng.Get(0, 255); country.ColourBlue = rng.Get(0, 255); return(country); }
public Cards Shuffle(Cards deck) { var shuffledDeck = new List <Card>(); var unshuffledDeck = Cards.With(deck.ToArray()); while (unshuffledDeck.HasCards) { var randomInt = m_RandomNumberGenerator.Get(0, unshuffledDeck.Count()); var nextCard = unshuffledDeck.CardAt(randomInt); unshuffledDeck.RemoveCardAt(randomInt); shuffledDeck.Add(nextCard); } return(Cards.With(shuffledDeck.ToArray())); }
public ViewModelWithDependancy(IRandomNumberGenerator generator) { Value = generator.Get(); }