private void SetCompMatchWinner(Player person1, double bestOfLimit) { if (person1.GetWinCount() == bestOfLimit) { person1.SetWinner(); } }
public void DualMatch(Player person1, Player person2, int bestOfNum) { double bestOfLimit = (double)bestOfNum / (double)2; bestOfLimit = Math.Ceiling(bestOfLimit); do { ScoreBoard(person1.GetName(), person2.GetName(), person1.GetWinCount(), person2.GetWinCount(), bestOfNum, bestOfLimit); player1Pick = " "; player2Pick = " "; player1Pick = GetPlayerPick(person1); ScoreBoard(person1.GetName(), person2.GetName(), person1.GetWinCount(), person2.GetWinCount(), bestOfNum, bestOfLimit); player2Pick = GetPlayerPick(person2); DetermineWinner(winTable); setDualWinCount(person1, person2); } while (bestOfNum > 1 && person1.GetWinCount() < bestOfLimit && person2.GetWinCount() < bestOfLimit); setDualWinner(person1, person2, bestOfLimit); }
private void setDualWinner(Player person1, Player person2, double bestOfLimit) { if (person1.GetWinCount() == bestOfLimit) { person1.SetWinner(); } else { person2.SetWinner(); } }
public void CompMatch(Player person1, int bestOfNum) { double bestOfLimit = (double)bestOfNum / (double)2; bestOfLimit = Math.Ceiling(bestOfLimit); int computerWinCount = 0; do { ScoreBoard(person1.GetName(), "AL", person1.GetWinCount(), computerWinCount, bestOfNum, bestOfLimit); player1Pick = " "; player2Pick = " "; player1Pick = GetPlayerPick(person1); ScoreBoard(person1.GetName(), "AL", person1.GetWinCount(), computerWinCount, bestOfNum, bestOfLimit); player2Pick = GetComputerPick(); DetermineWinner(winTable); computerWinCount = SetCompWinResults(person1, computerWinCount); } while (person1.GetWinCount() < bestOfLimit && computerWinCount < bestOfLimit); SetCompMatchWinner(person1, bestOfLimit); }