コード例 #1
0
    private depthInfo getTypeAndDepth(BoardWar board, int x)
    {
        int topy  = board.GetHighestYAtX(x);
        int type  = board.GetTopValueAtX(x);
        int depth = 1;

        for (int y = topy - 1; y >= 0; y--)
        {
            Tile val = board.GetValueAtXY(x, y);
            if (!val.IsDead() && val.GetColorVal() != type)
            {
                break;
            }
            depth++;
        }
        return(new depthInfo(x, type, depth, 0, topy));
    }
コード例 #2
0
 private bool AreAllTilesOfType(int x, int depth, int type)
 {
     for (int y = 5; y > 5 - depth; y--)
     {
         if (bo1.GetValueAtXY(x, y).GetColorVal() != type)
         {
             return(false);
         }
     }
     return(true);
 }