Exemple #1
0
        private TypeAndIndex[] Join2ArraysOfT0I(
            TypeAndIndex[] listA, TypeAndIndex[] listB)
        {
            TypeAndIndex[] retval = new TypeAndIndex[listA.Length + listB.Length];

            for (int i = 0; i < listA.Length; i++)
            {
                retval[i] = listA[i];
            }

            for (int j = listA.Length, bi = 0; j < listA.Length + listB.Length; j++, bi++)
            {
                retval[j] = listB[bi];
            }

            return(retval);
        }
Exemple #2
0
        private TypeAndIndex[] genElemsOfType(int type, int[] exceptionIndex, int count)
        {
            TypeAndIndex[] retval = new TypeAndIndex[count];

            int[] index =
                randomPickElemNoRepeat(
                    count, mFetcher.GetTypeElemCount(type), exceptionIndex);

            for (int i = 0; i < count; i++)
            {
                TypeAndIndex t0i = new TypeAndIndex();
                t0i.type  = type;
                t0i.index = index[i];
                retval[i] = t0i;
            }

            return(retval);
        }
Exemple #3
0
        private TypeAndIndex[] gen1ElemsFromEachType(int[] exceptionTypes, int count)
        {
            TypeAndIndex[] retval = new TypeAndIndex[count];

            int[] types = randomPickElemNoRepeat(count, 10, exceptionTypes);
            int[] index = new int[count];

            for (int i = 0; i < count; i++)
            {
                index[i] = mRDM.Next(0, mFetcher.GetTypeElemCount(types[i]));
            }

            for (int j = 0; j < count; j++)
            {
                TypeAndIndex t0i = new TypeAndIndex();
                t0i.type  = types[j];
                t0i.index = index[j];
                retval[j] = t0i;
            }

            return(retval);
        }