Ejemplo n.º 1
0
        //START BATTLE (reset)
        /// <summary>
        /// Sets up for a new trivia game
        /// </summary>
        /// <param name="pointsNeeded">The number of questions needed to win a trivia game.</param>
        /// <param name="turns">The number of turns in a trivia game</param>
        internal void StartTriviaGame(int pointsNeeded, int turns)
        {
            correctAnswersNeeded = pointsNeeded;
            correctAnswers       = 0;
            currentQuestion      = null;

            turnsLeft   = turns;
            triviaState = TriviaState.InProgress;
        }
Ejemplo n.º 2
0
 //CHECK TO SEE IF THEY WON
 /// <summary>
 /// Checks to see if the player has won the trivia game.
 /// It does nothing more and nothing less than that.
 /// </summary>
 /// <returns>If the player won the game (Priority given to winning), is still playing the game or lost the game.</returns>
 public TriviaState DidTheyWin()
 {
     if (correctAnswers >= correctAnswersNeeded)
     {
         return(triviaState = TriviaState.Won);
     }
     else if (turnsLeft != 0)
     {
         return(triviaState = TriviaState.InProgress);
     }
     else
     {
         return(triviaState = TriviaState.Lost);
     }
 }