mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[@types/pathfinding] Add missing args for getNodeAt (#37870)
This commit is contained in:
parent
dac596b02c
commit
0066b1f8b0
3
types/pathfinding/index.d.ts
vendored
3
types/pathfinding/index.d.ts
vendored
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user