예제 #1
0
 public void MoveRowsDown(bool[] isFull, int[] shiftAmount, PistonSet set)
 {
     for (int i = set.LowestRow(); i < set.NextLowestRow(); ++i)
     {
         if (!isFull[i])
         {
             MoveRowDown(i, -shiftAmount[i]);
         }
     }
 }
예제 #2
0
 public void DestroyRows(bool[] isFull, PistonSet set)
 {
     for (int i = set.LowestRow(); i < set.NextLowestRow(); ++i)
     {
         if (isFull[i])
         {
             DestroyRow(i);
         }
     }
 }
예제 #3
0
    // Update is called once per frame
    public void RequestDestroyRows(bool[] isFull, int[] shiftAmount, PistonSet set)
    {
        /* Debugging purpose */
        isFullForDebug      = isFull;
        shiftAmountForDebug = shiftAmount;
        setForDebug         = set;

        MoveTetrominoDown(isFull);
        DestroyRows(isFull, set);
        MoveRowsDown(isFull, shiftAmount, set);
    }
예제 #4
0
    public void SlideDown(bool[] isEmpty, PistonSet set)
    {
        isEmptyDebug = isEmpty;
        setDebug     = set;

        for (int row = set.LowestRow(); row < set.NextLowestRow(); ++row) // must be starting from 0
        {
            if (!isEmpty[row])
            {
                StartCoroutine(SlideDownRow(row));
            }
        }
    }