Ejemplo n.º 1
0
        public List <TrailsGroupSS> Get()
        {
            List <TrailsGroupSS> retval = new List <TrailsGroupSS>();

            //group
            for (int i = 0; i < mGroupArr.Length; i++)
            {
                //trails in group
                TrailsGroupSS group = new TrailsGroupSS();

                //gen random positions
                int[] pos = genRandom1to16Position(mGroupArr[i]);


                for (int j = 0; j < mGroupArr[i]; j++)
                {
                    int num = mRandom.Next(0, mWorking.Count);
                    //System.Console.Write(num + ",");

                    group.Trails.Add(new TrailSS_ST(mWorking[num].FileName,
                                                    mWorking[num].IsSymm, pos[j]));
                    mWorking.RemoveAt(num);

                    if (mWorking.Count == 0)
                    {
                        reArrange();
                    }
                }

                retval.Add(group);
            }
            return(retval);
        }
Ejemplo n.º 2
0
        public List <TrailsGroupSS> GetFixedItemGroups(int[] scheme)
        {
            List <TrailsGroupSS> retval  = new List <TrailsGroupSS>();
            TabFetcher           fetcher = new TabFetcher(mFixedItemsADDR, "\\t");

            fetcher.Open();

            //jump over exe
            for (int a = 0; a < 5; a++)//5 = 2 + 2  + 1(header)
            {
                fetcher.GetLineBy();
            }

            for (int i = 0; i < scheme.Length; i++)
            {
                TrailsGroupSS ss = new TrailsGroupSS();
                for (int j = 0; j < scheme[i]; j++)
                {
                    List <String> line = fetcher.GetLineBy();

                    TrailSS_ST st = new TrailSS_ST();
                    st.FileName = line[1] + ".bmp";
                    if (line[2] == "j")
                    {
                        st.IsSymm = false;
                    }
                    else
                    {
                        st.IsSymm = true;
                    }
                    st.Position = Int32.Parse(line[3]) - 1;
                    ss.Trails.Add(st);
                }

                retval.Add(ss);
            }

            fetcher.Close();
            return(retval);
        }