public Contestant PickWinner() { Contestant contestWinner = new Contestant(); contestRegNumber = rng.Next(1, 1000); //if (contestRegNumber == contestants[contestRegNumber])//try to just reference the key //{ // return contestWinner;//should be new contestant in the dictionary being returned //} //else //{ // PickWinner(); //} foreach (KeyValuePair <int, Contestant> contestant in contestants) { if (contestRegNumber == contestant.Key) { contestWinner = contestant.Value; } } return(contestWinner); }
public void PrintContestantInfo(Contestant contestant) { Console.WriteLine(contestant); }