public CreateHosts() { var randomNum = new Random(); var hosts = new NameYear().NamesWithYears; foreach (var host in hosts) { var age = randomNum.Next(18, 80); var id = randomNum.Next(0, 200); var newHost = new Host(host.Key, host.Value, age, id); HostList.Add(newHost); } }
public CreateHosts(int yearBorn, int currentYear) { CurrentYear = currentYear; YearBorn = yearBorn; var randomNum = new Random(); var hosts = new NameYear(yearBorn).NamesWithYears; foreach (var host in hosts) { var age = randomNum.Next(18, 80); var id = randomNum.Next(0, 200); var newHost = new Host(host.Key, host.Value, age, id); HostList.Add(newHost); } }