コード例 #1
0
 /// <summary>
 /// Create a Dijkstra pathfinder
 /// </summary>
 public Dijkstra(TPassible Passible, int width, int height, int startx, int starty, int endx, int endy)
 {
     StartX        = startx;
     StartY        = starty;
     EndX          = endx;
     EndY          = endy;
     Nodes         = new NodeMap(width, height);
     this.Passible = Passible;
 }
コード例 #2
0
 public Dijkstra(bool[,] BlockMap, int startx, int starty, int endx, int endy)
 {
     StartX        = startx;
     StartY        = starty;
     EndX          = endx;
     EndY          = endy;
     Nodes         = new NodeMap(BlockMap.GetLength(0), BlockMap.GetLength(1));
     this.BlockMap = BlockMap;
     Passible      = DefaultPassible;
 }
コード例 #3
0
        static public Path QuickPath(TPassible Passible, int width, int height, int startx, int starty, int endx, int endy)
        {
            var a = new Dijkstra(Passible, width, height, startx, starty, endx, endy);

            return(a.Start());
        }