Esempio n. 1
0
        //检查邻居节点合法性
        //*0
        //0*
        //斜方向
        static private bool UF_CheckNeibourhoodValid(ASGrid asGrid, ASGridData a, ASGridData b)
        {
            int minX   = a.X < b.X ? a.X : b.X;
            int minY   = a.Y < b.Y ? a.Y : b.Y;
            int vCount = 0;
            int width  = asGrid.width - 1;
            int height = asGrid.height - 1;

            for (int k = 0; k < 2; k++)
            {
                for (int i = 0; i < 2; i++)
                {
                    if (asGrid.UF_GetState(Math.Min(minX + i, width), Math.Min(minY + k, height)) == 0)
                    {
                        vCount++;
                    }
                }
            }

            return(vCount >= 3);
        }
Esempio n. 2
0
 public int UF_GetGridState(int x, int y)
 {
     return(m_ASGrid.UF_GetState(x, y));
 }