public void Roll(int roll) { Player player = _players[_currentPlayer]; Console.ForegroundColor = player.Color; Console.WriteLine($"{player.Name} is the current player"); Console.WriteLine($"They have rolled a {roll}"); if (player.IsPenaltyBox) { if (roll % 2 != 0) { player.IsGettingOutOfPenaltyBox = true; Console.WriteLine($"{player.Name} is getting out of the penalty box"); player.Place += roll; if (player.Place > 11) { player.Place -= 12; } QuestionCategory questionCategory = GetCurrentCategory(player.Place); Console.WriteLine($"{player.Name}\'s new location is {player.Place}"); Console.WriteLine($"The category is {questionCategory}"); AskQuestions(player); } else { Console.WriteLine($"{player.Name} is not getting out of the penalty box"); player.IsGettingOutOfPenaltyBox = false; } } else { player.Place += roll; if (player.Place > 11) { player.Place -= 12; } QuestionCategory questionCategory = GetCurrentCategory(player.Place); Console.WriteLine($"{player.Name}\'s new location is {player.Place}"); Console.WriteLine($"The category is {questionCategory}"); AskQuestions(player); } }
public LinkedList <string> Dodo(QuestionCategory category) { var questions = new LinkedList <string>(); for (int i = 0; i < QuestionCount; i++) { questions.AddLast($"{category} Question " + i); } return(questions); }
private void AskQuestions(Player player) { QuestionCategory category = GetCurrentCategory(player.Place); if (_questions.Count == 0) { Console.WriteLine("Questions in this category is over."); return; } string question = _questions[category].First(); _questions[category].RemoveAt(0); Console.WriteLine(question); }