Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Roulette_Game/ResultDisplay.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
32 lines (27 sloc)
1.25 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ResultDisplay | |
{ | |
// Display the result of a single round | |
public void DisplayRoundResult(RoundResult result, int playerBalance) | |
{ | |
// Display the winning number, winning color, bet type, bet amount, winnings, and player balance | |
Console.WriteLine($"Winning Number: {result.WinningNumber}, Winning Color: {result.WinningColor}, Bet Type: {result.Bet.Type}, Bet Amount: {result.Bet.Amount}, Winnings: {result.Winnings}, Player Balance: {playerBalance}"); | |
} | |
// Display the history of all rounds played | |
public void DisplayHistory(List<RoundResult> roundResults, int currentBalance) | |
{ | |
// Display the header for the round history | |
Console.WriteLine("Round History:"); | |
// Initialize round count | |
int roundCount = 1; | |
// Iterate through each round result and display it | |
foreach (RoundResult result in roundResults) | |
{ | |
// Display the round number | |
Console.WriteLine($"Round {roundCount++}:"); | |
// Display the details of the round | |
DisplayRoundResult(result, currentBalance); | |
// Add an empty line for better readability | |
Console.WriteLine(); | |
} | |
} | |
} |