You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
0, false, null, undefined should map to unwalkable, everything else should be walkable.
But providing a predicate to the config to determine if the value is acceptable would be good too. And at the same time accepting an object array instead of a numeric array would be useful so that I can pass in an array of Tile objects (I'm using Phaser tilemaps in this case) and have a callback that determines whether that tile is walkable or not.
Activity
veleek commentedon Jan 28, 2021
The current code appears to accept any boolean-ish value:
astar-typescript/lib/core/grid.ts
Line 88 in 8c955f6
0, false, null, undefined should map to unwalkable, everything else should be walkable.
But providing a predicate to the config to determine if the value is acceptable would be good too. And at the same time accepting an object array instead of a numeric array would be useful so that I can pass in an array of Tile objects (I'm using Phaser tilemaps in this case) and have a callback that determines whether that tile is walkable or not.