Exemple #1
0
        public List <CRW_Question> GetCRW_QuestionByList(CRW_Level level)
        {
            List <CRW_Question> r = new List <CRW_Question>();

            var list = TiKu.InitList();

            Random random = new Random();

            for (int index = 0; index < level.QuestionCount; index++)
            {
                int randomIndex = random.Next(TiKu.ListCount);
                var randTiKu    = list[randomIndex];

                CRW_Question toAdd = new CRW_Question();

                toAdd.CRWTypeID = level.CRWTypeID;

                toAdd.No           = index + 1;
                toAdd.Left         = randTiKu.Left;
                toAdd.Symbol       = randTiKu.Symbol;
                toAdd.Right        = randTiKu.Right;
                toAdd.EqualsSymbol = randTiKu.EqualsSymbol;
                toAdd.Result       = randTiKu.Result;
                toAdd.TTSMsg       = "{0}{1}{2}".FormatWith(ToChineseNumber(toAdd.Left),
                                                            ToChineseSymbol(toAdd.Symbol),
                                                            ToChineseNumber(toAdd.Right));


                toAdd.ChangeStatus(CRW_Question_Status.Remember);

                r.Add(toAdd);
            }

            return(r);
        }
Exemple #2
0
 public CRWBll()
 {
     TiKu.InitList();
 }