static void DetermineWinner(PlayerReal player1, PlayerAI player2) { player1.generateRoshambo(); player2.generateRoshambo(); Console.WriteLine($"{player1.Name} played {player1.Choice}\n{player2.Name} played {player2.Choice}"); if (player1.Choice == player2.Choice) { Console.WriteLine("TIE ROUND!"); } else if (player1.Choice == Roshambo.Paper) { if (player2.Choice == Roshambo.Rock) { player1.Wins++; Console.WriteLine($"\n{player1.Name} Won!"); } else { player2.Wins++; Console.WriteLine($"\n{player2.Name} Won!"); } } else if (player1.Choice == Roshambo.Rock) { if (player2.Choice == Roshambo.Scissors) { player1.Wins++; Console.WriteLine($"\n{player1.Name} Won!"); } else { player2.Wins++; Console.WriteLine($"\n{player2.Name} Won!"); } } else if (player1.Choice == Roshambo.Scissors) { if (player2.Choice == Roshambo.Paper) { player1.Wins++; Console.WriteLine($"\n{player1.Name} Won!"); } else { player2.Wins++; Console.WriteLine($"\n{player2.Name} Won!"); } } Console.WriteLine($"{player1.Wins} | {player2.Wins}"); }
static void SelectOpponent() { Console.WriteLine(); foreach (string item in players.Keys) { if (item != selectedPlayer.Name) { Console.WriteLine(item); } } string sel = RPSValidator.GetInput("Select your Opponent", true); PlayerReal temp = (PlayerReal)players.GetValueOrDefault(sel); selectedOpponent = new PlayerAI(temp.Name, temp.Wins); Console.WriteLine($"Existing Player: {selectedOpponent.Name} | {selectedOpponent.Wins}"); }