Beispiel #1
0
        protected override void Initialize()
        {
            base.Initialize();
            if (fMap == null)
            {
                fMap = new uint[mapWidth, mapHeight];
            }
            else
            {
                Array.Clear(fMap, 0, fMap.Length);
            }
            if (gMap == null)
            {
                gMap = new uint[mapWidth, mapHeight];
            }
            else
            {
                Array.Clear(fMap, 0, fMap.Length);
            }
            fMap.SetGrid(infinite);
            gMap.SetGrid(infinite);

            openset.Enqueue(0, start);
            inOpenset[sx, sy] = true;
            gMap[sx, sy]      = 0;
            fMap[sx, sy]      = heuristicFunction(sx, sy, gx, gy);
        }