Example #1
0
 public GameRunner(GameSetup currentSetup, PlayerFactory currentFactory, QuestionCaller currentCaller)
 {
     for (int i = 0; i < currentSetup.RoundAmount; i++)
     {
         for (int a = 0; a < currentFactory.PlayerAmount; a++)
         {
             Console.WriteLine("Your turn " + currentFactory.PlayerList[a].Name + " <<>>");
             string currentQuestion = currentCaller.callNextQuestion();
             questionBox(currentQuestion);
             Console.WriteLine("Please answer with [yes] or [no]");
             string currentAnswer = Console.ReadLine();
             if (currentAnswer == "yes" || currentAnswer == "Yes")
             {
                 Console.WriteLine("\nAll right you DRINK: " + currentSetup.SipAmount + " sips!\n");
                 currentFactory.PlayerList[a].SipCounter += 1;
             }
             else
             {
                 Console.WriteLine("\nWell ok then :)\n");
                 currentFactory.PlayerList[a].DryCounter += 1;
             }
         }
     }
     gameOver();
     Console.WriteLine("But here are the results: \n");
     for (int a = 0; a < currentFactory.PlayerAmount; a++)
     {
         Console.WriteLine(currentFactory.PlayerList[a].Name + " << you had to drink[ " + currentFactory.PlayerList[a].SipCounter + " ]times[ " + currentSetup.SipAmount + " ]sips");
         Console.WriteLine("So in total[ " + currentFactory.PlayerList[a].SipCounter * currentSetup.SipAmount + " ]sips\n");
     }
 }
Example #2
0
 static void Main(string[] args)
 {
     GameSetup      newSetup      = new GameSetup();
     PlayerFactory  newPlayers    = new PlayerFactory();
     QuestionCaller newQC         = new QuestionCaller();
     GameRunner     newGameRunner = new GameRunner(newSetup, newPlayers, newQC);
 }