Пример #1
0
        public void TestAddMatchingAnswer()
        {
            CurrentQuiz.Data.AddNewTask(new CreatorMatchingTask());
            CurrentQuiz.Data.Tasks[0].AddNewAnswer();
            MatchingTask task = CurrentQuiz.Data.Tasks[0] as MatchingTask;

            Assert.AreEqual(task.Answers[0].Value, "Ваш ответ...");
            Assert.AreEqual(task.Answers[0].GetType(), typeof(MatchingAnswer));
        }
Пример #2
0
        public void TestAddMatchingTask()
        {
            Quiz quiz = new Quiz("MyQuiz");

            quiz.AddNewTask(new CreatorMatchingTask());
            Assert.AreEqual(quiz.Tasks.Count, 1);
            MatchingTask task = quiz.Tasks[0] as MatchingTask;

            Assert.IsNotNull(task);
            Assert.AreEqual(task.Question, "Введите вопрос...");
            Assert.AreEqual(task.Point, 1);
            Assert.AreEqual(task.Answers.Count, 0);
            Assert.AreEqual(task.Answers.GetType(), typeof(ObservableCollection <MatchingAnswer>));
        }
Пример #3
0
    private IEnumerator UpdateAsync(MatchingTask task)
    {
        if (matchingAsync != null) {
            StopCoroutine (matchingAsync);
        }

        switch (task) {
        case MatchingTask.JoinLobby:
            yield return StartCoroutine (matchingAsync = WaitJoinLobbyAsync ());
            break;
        case MatchingTask.LeaveLobby:
            yield return StartCoroutine (matchingAsync = WaitLeaveLobbyAsync ());
            break;
        case MatchingTask.JoinRoom:
            yield return StartCoroutine (matchingAsync = WaitJoinRoomAsync ());
            break;
        case MatchingTask.LeaveRoom:
            yield return StartCoroutine (matchingAsync = WaitLeaveRoomAsync ());
            break;
        case MatchingTask.PlayStart:
            PhotonNetwork.RPC (matchingUser.photonView
                , "RpcPlayStart"
                , PhotonTargets.All
                , false
            );
            if (PhotonNetwork.isMasterClient) {
                logger.Log ("hide room");
                PhotonNetwork.room.visible = false;
            }
            break;
        }
    }
Пример #4
0
 public void TaskMatch(MatchingTask task)
 {
     matchingTask = task;
 }