/// <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); } }
/************************************************************************************** * 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++; } }
/************************************************************************************** * 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(); } }