Exemple #1
0
 int Match2(int x, int y, SBlock.BlockType key)
 {
     if (mBlockArray[x, y].isChecked == true)
     {
         return(0);
     }
     mBlockArray[x, y].isChecked = true;
     if (x < 1 || x > 6)
     {
         return(0);
     }
     if (mBlockArray[x, y].mType != key)
     {
         return(0);
     }
     return(1);
 }
Exemple #2
0
    int CheckBlockoverHorizontal(int x, int y, SBlock.BlockType type)
    {
        if (x < 1 || x > 6)
        {
            return(0);
        }
        if (mBlockArray[x, y].mType != type)
        {
            return(0);
        }
        if (mBlockArray[x, y].mState == SBlock.BlockState.Match)
        {
            return(0);
        }


        //mBlockArray[x, y].SetStateToMatch();


        return(1 +
               CheckBlockoverHorizontal(x - 1, y, type) +
               CheckBlockoverHorizontal(x + 1, y, type));
    }