Example #1
0
    public static void InitSimpleResult(GetSimpleResultEvent simpleEvent
                                        , ScriptBetting scriptBetting, ScriptQuizResult scriptQuizResult)
    {
        if (simpleEvent.Response.data == null ||
            simpleEvent.Response.data.Count < 1)
        {
            return;
        }

        QuizInfo quiz = null;

        foreach (QuizInfo quizInfo in QuizMgr.QuizList)
        {
            if (quizInfo.quizListSeq == simpleEvent.Response.data [0].quizListSeq)
            {
                quiz = quizInfo;
                break;
            }
        }
        if (quiz == null)
        {
            return;
        }

        Debug.Log("InitSimpleResult2");
        quiz.quizValue = simpleEvent.Response.data [0].quizValue;

        quiz.resp = new List <QuizRespInfo> ();
        QuizRespInfo tmpInfo;

        if (simpleEvent.Response.data.Count > 1)
        {
            //got 2 answers
            tmpInfo                   = new QuizRespInfo();
            tmpInfo.respValue         = simpleEvent.Response.data[1].respValue;
            tmpInfo.expectRewardPoint = int.Parse(simpleEvent.Response.data[1].rewardPoint);
            quiz.resp.Add(tmpInfo);
        }

        tmpInfo                   = new QuizRespInfo();
        tmpInfo.respValue         = simpleEvent.Response.data[0].respValue;
        tmpInfo.expectRewardPoint = int.Parse(simpleEvent.Response.data[0].rewardPoint);
        quiz.resp.Insert(0, tmpInfo);

        if (ShowQuizResult(quiz, simpleEvent, scriptQuizResult))
        {
            scriptQuizResult.InitParticle();
        }

        scriptBetting.UpdateHitterItem(quiz);
    }
Example #2
0
    public static void InitSimpleResult(GetSimpleResultEvent simpleEvent
                                        , ScriptBetting scriptBetting, ScriptQuizResult scriptQuizResult)
    {
        Debug.Log("InitSimpleResult");
        if (simpleEvent.Response.data == null ||
            simpleEvent.Response.data.Count < 1)
        {
            Debug.Log("return");
            return;
        }

        QuizInfo quiz = null;

        foreach (QuizInfo quizInfo in QuizMgr.QuizList)
        {
            if (quizInfo.quizListSeq == simpleEvent.Response.data [0].quizListSeq)
            {
                quiz = quizInfo;
                break;
            }
        }
        if (quiz == null)
        {
            Debug.Log("return re");
            return;
        }

        quiz.quizValue = simpleEvent.Response.data [0].quizValue;

        if (simpleEvent.Response.data[0].isCancel > 0)
        {
            quiz.resultMsg = simpleEvent.Response.data[0].resultMsg;
            Debug.Log("simpleEvent.Response.data[0].respStatus : " + simpleEvent.Response.data[0].respStatus);
        }
        if (simpleEvent.Response.data [0].respStatus > 0 ||
            simpleEvent.Response.data [0].isCancel > 0)
        {
            quiz.resp = new List <QuizRespInfo> ();
            QuizRespInfo tmpInfo;
            if (simpleEvent.Response.data.Count > 1)
            {
                //got 2 answers
                tmpInfo                   = new QuizRespInfo();
                tmpInfo.respValue         = simpleEvent.Response.data [1].respValue;
                tmpInfo.expectRewardPoint = int.Parse(simpleEvent.Response.data [1].rewardPoint);
                quiz.resp.Add(tmpInfo);
            }

            tmpInfo                   = new QuizRespInfo();
            tmpInfo.respValue         = simpleEvent.Response.data [0].respValue;
            tmpInfo.expectRewardPoint = int.Parse(simpleEvent.Response.data [0].rewardPoint);
            quiz.resp.Insert(0, tmpInfo);
            Debug.Log("simpleEvent.Response.data[0].isCancel : " + simpleEvent.Response.data [0].isCancel);
            if (ScriptMainTop.OpenBettingCheck)
            {
                if (simpleEvent.Response.data [0].isCancel > 0)
                {
                    ShowQuizResult(quiz, simpleEvent, scriptQuizResult);
                }
                else
                {
//			if(simpleEvent.Response.data[0].isCancel < 1){
                    if (ShowQuizResult(quiz, simpleEvent, scriptQuizResult))
                    {
                        scriptQuizResult.InitParticle();
                    }
                }
            }
        }

        scriptBetting.UpdateHitterItem(quiz);
    }