예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            }
        }