public ResponseTypesRepository(ResponseTypesDB context, AccusationsDB contextAccusations, ComplementsDB contextComplements, FarewellsDB contextFarewells, GreetingsDB contextGreetings, InvitationsOffersDB contextInvitationsOffers, QuestionsDB contextQuestions, RequestsForInformationDB contextRequestsForInformation)
 {
     _context                       = context;
     _contextAccusations            = contextAccusations;
     _contextComplements            = contextComplements;
     _contextFarewells              = contextFarewells;
     _contextGreetings              = contextGreetings;
     _contextInvitationsOffers      = contextInvitationsOffers;
     _contextQuestions              = contextQuestions;
     _contextRequestsForInformation = contextRequestsForInformation;
 }
Example #2
0
 void Awake()
 {
     qDB = new QuestionsDB();
     //maxQuestionNumber = 15;
     questionNumber = 0;
     //nextButtonID = 0;
     answerScripts = new AnswerButtonScript[4];
     for (int i = 0; i < answerButtons.Length; i++)
     {
         answerScripts[i] = answerButtons[i].GetComponent <AnswerButtonScript>();
     }
 }
Example #3
0
    private void Update()
    {
        if (BattleController.isInBattle)
        {
            return;
        }

        if (powerClicked >= 0)
        {
            var answerGiven = GetAnswer(ref answerPower, powerClicked);
            if (answerGiven == -2)
            {
                answerPower = GiveAnswerPower(currentQuestion.type);                    // no answer corresponds to the choosen symbol
            }
            if (answerGiven >= 0)
            {
                if (answerGiven == 1)
                {
                    PlayerStats.power_experience[answerPower[0]] += currentQuestion.difficulty;
                    currentQuestion.wasRight = true;
                }
                else
                {
                    currentQuestion.wasRight = false;
                }
                questionsAnswered.Add(currentQuestion);
                //QuestionsDB.Remove(currentQuestion);
                print(currentQuestion.wasRight);
                currentQuestion = null;
            }
            powerClicked = -1;
        }
        if (currentQuestion == null)   // get new question and randomize answer power icon
        {
            currentQuestion = QuestionsDB.GetRandomQuestion();
            if (currentQuestion != null)
            {
                answerPower = GiveAnswerPower(currentQuestion.type);
                answerOrder.Clear();
                for (var i = 0; i < currentQuestion.answer.Length; i++)
                {
                    answerOrder.Add(i);
                }
                answerOrder = answerOrder.randomized();
            }
        }
    }
Example #4
0
 void Start()
 {
     qDB = new QuestionsDB();
 }
 public QuestionsRepository(QuestionsDB context, QuestionSimilesDB contextQuestionSimiles)
 {
     _context = context;
     _contextQuestionSimiles = contextQuestionSimiles;
 }
 private void Awake()
 {
     iPower.Init();
     QuestionsDB.Init();
 }
Example #7
0
 public TopicsRepository(TopicsDB context, QuestionsDB contextQuestions, RequestsForInformationDB contextRequestsForInformation)
 {
     _context          = context;
     _contextQuestions = contextQuestions;
     _contextRequestsForInformation = contextRequestsForInformation;
 }