Example #1
0
        public override ExamPage OnClickFunc(IPlayContext context = null)
        {
            base.OnClickFunc(context);
            if (NextPage != null)
            {
                NextPage.SetProbability(CurrProbability);
                return(NextPage);
            }

            var probability = _numberGenerator.NextDouble01();

            if (probability > CurrProbability || probability >= 0.999)
            {
                SuccessPage = SuccessPage ?? new ExamSuccessPage();
                return(SuccessPage);
            }

            FailPage = FailPage ?? new ExamFailPage();
            return(FailPage);
        }