Esempio n. 1
0
    void CheckAnswerValue(string first, string second)
    {
        float internationalValue = 0;
        float domesticValue      = 0;

        story.SaveTerms(selectedQuestion, first, second);

        foreach (string a in selectedQuestion.boostingAnswers)
        {
            if (a == first)
            {
                domesticValue      += selectedQuestion.firstAnswerDomesticPoints;
                internationalValue += selectedQuestion.firstAnswerInternationalPoints;
            }

            else if (a == second)
            {
                domesticValue      += selectedQuestion.secondAnswerDomesticPoints;
                internationalValue += selectedQuestion.secondAnswerInternationalPoints;
            }
        }

        foreach (string a in selectedQuestion.reducingAnswers)
        {
            if (a == first)
            {
                domesticValue      -= selectedQuestion.firstAnswerDomesticPoints;
                internationalValue -= selectedQuestion.firstAnswerInternationalPoints;
            }

            else if (a == second)
            {
                domesticValue      -= selectedQuestion.secondAnswerDomesticPoints;
                internationalValue -= selectedQuestion.secondAnswerInternationalPoints;
            }
        }

        if (selectedQuestion.questionType == QuestionType.Domestic)
        {
            if (domesticValue >= 0)
            {
                if (selectedQuestion.objectName == "Army")
                {
                    story.positives[1] = true;
                }
                else if (selectedQuestion.objectName == "Drugs")
                {
                    story.positives[2] = true;
                }
                else if (selectedQuestion.objectName == "Overseas")
                {
                    story.positives[5] = true;
                }
                else if (selectedQuestion.objectName == "Rebels")
                {
                    story.positives[8] = true;
                }
                else if (selectedQuestion.objectName == "Funding")
                {
                    story.positives[10] = true;
                }
            }
        }

        else
        {
            if (internationalValue >= 0)
            {
                selectedQuestion.isPositive = true;
            }

            else
            {
                selectedQuestion.isPositive = false;
            }
        }
        firstPreviously = first;
        handler.ChangeValue(domesticValue, internationalValue);
    }