Пример #1
0
    void CheckFactors(NumberInfo ni)
    {
        return;

//		Fraction total = new Fraction(0,1);


        // We want to randomize WHICH lattice number is checked first, so first put them all in a list.

        for (int i = 0; i < latticeNums.GetLength(0); i++)    // Go each row
        // Each col go by 2s, always start from 2nd column in.
        {
            for (int j = 0; j < latticeNums.GetLength(1); j++)
            {
                int oddRow = 0;
                if (i % 2 == 1)
                {
                    oddRow = 1;
                    if (j == latticeNums.GetLength(1) - 1)
                    {
                        continue;                                                        // skip because of staggering fx
                    }
                }
                NumberInfo ni2 = latticeNums[i, j].ni;
                if (Fraction.Equals(Fraction.GetAbsoluteValue(ni2.fraction), Fraction.GetAbsoluteValue(ni.fraction)) && latticeNums[i, j].acting == false && ni.GetComponent <Rigidbody>().useGravity == true)
                {
//					affectedNumbers.Add (ni);
                    SMW_GF.inst.DrawLineFromTo(ni2.transform, ni.transform, Color.blue);
                    FreezeAndDestroy(ni);
                    latticeNums[i, j].acting      = true;
                    latticeNums[i, j].actingTimer = secondsToFreezePerAct;
                    break;
                }
                if (Fraction.AIsFactorOfB(ni2.fraction, ni.fraction) && latticeNums[i, j].acting == false && ni.GetComponent <Rigidbody>().useGravity == true)
                {
//					affectedNumbers.Add (ni);
                    // Freeze, split, and draw lines to number
                    SMW_GF.inst.DrawLineFromTo(ni2.transform, ni.transform, Color.blue);
                    SplitNumber(ni, ni2);
                    latticeNums[i, j].acting      = true;
                    latticeNums[i, j].actingTimer = secondsToFreezePerAct;
                    break;
                }
            }
        }
    }