[@types/pathfinding] Add missing args for getNodeAt (#37870)

This commit is contained in:
Hartley Robertson 2019-09-07 01:31:28 +01:00 committed by Andrew Casey
parent dac596b02c
commit 0066b1f8b0
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
// Type definitions for pathfinding
// Project: https://github.com/qiao/PathFinding.js
// Definitions by: BNedry <https://github.com/BNedry>
// Hartley Robertson <https://github.com/hartleyrobertson>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "pathfinding" {
@ -65,7 +66,7 @@ declare module "pathfinding" {
clone(): Grid;
getNodeAt(): Pathfinding.Node;
getNodeAt(x: number, y: number): Pathfinding.Node;
getNeighbors(node: Pathfinding.Node, diagonalMovement: DiagonalMovement): Pathfinding.Node[];
isWalkableAt(x: number, y: number): boolean;
isInside(x: number, y: number): boolean;

View File

@ -7,9 +7,10 @@ var matrix = [
];
var grid = new PF.Grid(matrix);
var gridBackup = grid.clone();
var node = grid.getNodeAt(0, 0);
var finder = new PF.AStarFinder();
var path = finder.findPath(1, 2, 4, 2, grid);
var newPath = PF.Util.smoothenPath(grid, path);
var newPath = PF.Util.smoothenPath(grid, path);