Пример #1
0
        /// <summary>
        /// copy path data to array
        /// </summary>
        /// <returns></returns>
        public DHVertex[] GetPathData()
        {
            if (IsNull)
            {
                return(null);
            }
            DHVertex *vertices = Native.dh_getpathdata(path);
            var       ret      = new DHVertex[Length];

            for (int i = 0; i < Length; i++)
            {
                ret[i] = vertices[i];
            }
            return(ret);
        }
Пример #2
0
        public DHVertex[] GetVertexes()
        {
            if (IsNull || !mapLoaded)
            {
                return(null);
            }
            void *vuv1  = (void *)0;
            int   size1 = 0;

            Native.dh_get_vectices(dh, ref vuv1, &size1);
            var ret = new DHVertex[size1];

            for (int i = 0; i < size1; i++)
            {
                DHVertex *ut = (DHVertex *)vuv1;
                ret[i] = ut[i];
            }
            return(ret);
        }
Пример #3
0
        public bool FindPath(bool isStraight, DHVertex start, DHVertex end, DHPath result)
        {
            if (IsNull)
            {
                return(false);
            }
            int  len = 0;
            bool res = false;

            if (isStraight)
            {
                res = Native.dh_find_straight_path(dh, ref start, ref end, result, ref len);
            }
            else
            {
                res = Native.dh_findpath(dh, ref start, ref end, result, ref len);
            }
            if (res)
            {
                result.Length = len;
            }
            return(res);
        }
Пример #4
0
 unsafe public static extern bool dh_find_straight_path(IntPtr dh, ref DHVertex start, ref DHVertex end, void *path, ref int length);