public Member GetLoser() { if (PlayerOneScore.GetTotalScore() < PlayerTwoScore.GetTotalScore()) { return(PlayerOne); } return(PlayerOneScore.GetTotalScore() > PlayerTwoScore.GetTotalScore() ? PlayerTwo : null); }
public void GeneratePlayerScores() { var random = new Random(); PlayerOneScore.SetOne = random.Next(0, 101); PlayerOneScore.SetTwo = random.Next(0, 101); PlayerOneScore.SetThree = random.Next(0, 101); PlayerTwoScore.SetOne = random.Next(0, 101); PlayerTwoScore.SetTwo = random.Next(0, 101); PlayerTwoScore.SetThree = random.Next(0, 101); Console.WriteLine("Player One Score Generated: " + PlayerOneScore.SetOne + ", " + PlayerOneScore.SetTwo + ", " + PlayerOneScore.SetThree + " Totals:" + PlayerOneScore.GetTotalScore()); Console.WriteLine("Player Two Score Generated: " + PlayerTwoScore.SetOne + ", " + PlayerTwoScore.SetTwo + ", " + PlayerTwoScore.SetThree + " Totals:" + PlayerTwoScore.GetTotalScore()); if (GetWinner() != null) { Console.WriteLine("Winner: " + GetWinner().Name); } else { Console.WriteLine("Draw"); } }
public void SetPlayerOneScore(double setOne, double setTwo, double setThree) { PlayerOneScore.SetOne = setOne; PlayerOneScore.SetTwo = setTwo; PlayerOneScore.SetThree = setThree; Console.WriteLine("Player One's Score: " + setOne + ", " + setTwo + ", " + setThree + " Totals:" + PlayerOneScore.GetTotalScore()); }