public override void HandleCorrect(EquationController equation)
 {
     equation.DisplayCorrect();
     result.ApplyEquationResult(EquationResult.CreateFromEquation(equation, true));
     equation.SelectNewAnswer();
     equationsLeft--;
 }
Ejemplo n.º 2
0
 private void HandleIncorrect(EquationController equation)
 {
     modeController.HandleIncorrect(equation);
     GetBackgroundColorController().SetColors(new Color[] {
         new Color(1, 0, 0),
         GetBackgroundColorController().GetCurrentColor()
     }, GameSettings.Instance.TransitionSpeed);
 }
    public override void HandleIncorrect(EquationController equation)
    {
        // This is their guess if the've guessed the max number of times allowed
        bool noMoreGuessesLeft = equation.GetNumberOfGuesses() == GameSettings.Instance.ClassicMode_Guesses;

        // we destroy this equation if it's their last guess
        equation.DisplayIncorrect(noMoreGuessesLeft);

        if (noMoreGuessesLeft)
        {
            result.ApplyEquationResult(EquationResult.CreateFromEquation(equation, false));
            equation.SelectNewAnswer();
            equationsLeft--;
        }
    }
Ejemplo n.º 4
0
    public void CheckAnswerToEquation(EquationController equation)
    {
        float userAnswer    = GetUserAnswer();
        float correctAnswer = equation.GetAnswer();

        if (userAnswer == correctAnswer)
        {
            HandleCorrect(equation);
        }
        else
        {
            HandleIncorrect(equation);
        }

        GetUserInputController().ClearAnswer();
    }
Ejemplo n.º 5
0
 public static EquationResult CreateFromEquation(EquationController equation, bool wasCorrect)
 {
     return(new EquationResult(equation.GetTerms(), equation.GetAnswer(), wasCorrect));
 }
Ejemplo n.º 6
0
 public abstract void HandleIncorrect(EquationController equation);