예제 #1
0
        private void getFixedDataReady()
        {
            mAllFixedItems =
                mFixedReader.GetContext(RESPATH + "test.txt");

            SybSrhSourceFetcher fetcher =
                new SybSrhSourceFetcher(PageSybSrh.RESPATH);

            for (int i = 0; i < mAllFixedItems.Count; i++)
            {
                for (int tarI = 0; tarI < 2; tarI++)
                {
                    mAllFixedItems[i].Target[tarI].BMP =
                        fetcher.GetPic(mAllFixedItems[i].Target[tarI].Type,
                                       mAllFixedItems[i].Target[tarI].Index);
                }

                for (int selI = 0; selI < 5; selI++)
                {
                    mAllFixedItems[i].Selection[selI].BMP =
                        fetcher.GetPic(mAllFixedItems[i].Selection[selI].Type,
                                       mAllFixedItems[i].Selection[selI].Index);
                }
            }
        }
예제 #2
0
        private List <SybSrhItem> get4Exercises()
        {
            List <SybSrhItem> retval =
                mFixedReader.GetContext(RESPATH + "sybsrhprac.txt");
            SybSrhSourceFetcher fetcher =
                new SybSrhSourceFetcher(PageSybSrh.RESPATH);

            for (int i = 0; i < retval.Count; i++)
            {
                for (int tarI = 0; tarI < 2; tarI++)
                {
                    retval[i].Target[tarI].BMP =
                        fetcher.GetPic(retval[i].Target[tarI].Type,
                                       retval[i].Target[tarI].Index);
                }

                for (int selI = 0; selI < 5; selI++)
                {
                    retval[i].Selection[selI].BMP =
                        fetcher.GetPic(retval[i].Selection[selI].Type,
                                       retval[i].Selection[selI].Index);
                }
            }

            return(retval);
        }
예제 #3
0
        private List <SybSrhItem> gen1PosNegByHalf()
        {
            List <SybSrhItem> retval = new List <SybSrhItem>();
            int typeTemp             = -1;
            int posTarTemp           = -1;
            int posSelectionTemp     = -1;
            int picIndexTemp         = -1;

            for (int i = 0; i < 12; i++)
            {
                typeTemp     = mRDM.Next(0, 10);
                picIndexTemp = mRDM.Next(0, mFetcher.GetTypeElemCount(typeTemp));
                Bitmap bmp =
                    mFetcher.GetPic(typeTemp, picIndexTemp);

                posTarTemp       = mRDM.Next(0, 2);
                posSelectionTemp = mRDM.Next(0, 5);

                SybSrhItem       item   = new SybSrhItem();
                SybSrhVisualElem target = new SybSrhVisualElem();
                target.BMP   = bmp;
                target.Type  = typeTemp;
                target.Index = picIndexTemp;

                //item.Targets[posTarTemp] = bmp;
                //item.Info.TargetsTypes[posTarTemp] = typeTemp;//save info
                //item.Info.TargetsPicIndex[posTarTemp] = picIndexTemp;

                if (i < 6)//one target has a same selection
                {
                    //mark as true
                    target.IfTrue = true;
                    //selections
                    SybSrhVisualElem selection = new SybSrhVisualElem();
                    selection.BMP    = bmp;
                    selection.IfTrue = true;
                    selection.Type   = typeTemp;
                    selection.Index  = picIndexTemp;
                    item.Selection[posSelectionTemp] = selection;
                }

                item.Target[posTarTemp] = target;

                retval.Add(item);
            }

            return(retval);
        }