コード例 #1
0
ファイル: QuestionManager.cs プロジェクト: Hindi/C3P0GitHub
 /// <summary>
 /// Copy constructor.
 /// </summary>
 public QuestionKeeper(QuestionKeeper q)
 {
     id           = q.id;
     question     = q.question;
     reponses     = new List <string>();
     bonneReponse = q.bonneReponse;
     explication  = q.explication;
     foreach (string s in q.reponses)
     {
         reponses.Add(s);
     }
 }
コード例 #2
0
ファイル: QuestionManager.cs プロジェクト: Hindi/C3P0GitHub
    /**************************************************************************************
    * Public functions                                                                   *
    **************************************************************************************/

    /// <summary>This function sends the question to the clients.</summary>
    /// <returns>void</returns>
    public void sendQuestion()
    {
        if (!waitForAnswers)
        {
            waitForAnswers   = true;
            questionSendTime = Time.time;
            questionBuffer   = new QuestionKeeper(questionList[currentQuestionNb]);
            oldQuestions.Add(new QuestionKeeper(questionBuffer));
            C3PONetworkManager.Instance.sendQuestion(questionBuffer);
            currentQuestionNb++;
        }
    }
コード例 #3
0
ファイル: QuestionManager.cs プロジェクト: Hindi/C3P0GitHub
    /**************************************************************************************
    * Public Constructor                                                                 *
    **************************************************************************************/
    /// <summary>Public constructor.</summary>
    public QuestionManager()
    {
        if (instance != null)
        {
            throw new System.Exception("Cannot create a new instance of QuestionManager because there's one");
        }
        else
        {
            instance = this;

            oldQuestions = new List <QuestionKeeper>();

            questionBuffer = new QuestionKeeper();
        }
    }