Constructor
new PathfindingScheduler(optionsopt)
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | <optional> | Properties
|
Classes
Methods
cancel(id) → {boolean}
Cancel a request by ID.
Parameters:
| Name | Type | Description |
|---|---|---|
id | number |
Returns:
- Type:
- boolean
cancelRequester(requester) → {number}
Cancel all requests from a specific requester (e.g. destroyed NPC).
Parameters:
| Name | Type | Description |
|---|---|---|
requester | object |
Returns:
Count of canceled requests
- Type:
- number
requestPath(grid, start, goal, optionsopt) → {Promise.<NavigationPath>}
Submit an asynchronous pathfinding request.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
grid | object | NavigationGrid instance | |||||||||||||||||||||
start | object | { x, y } | |||||||||||||||||||||
goal | object | { x, y } | |||||||||||||||||||||
options | object | <optional> | Properties
|
Returns:
- Type:
- Promise.<NavigationPath>
update(budgetMsopt, maxRequestsopt) → {number}
Process pending requests within the configured frame budget.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
budgetMs | number | <optional> | Optional override of time budget |
maxRequests | number | <optional> | Optional override of request count budget |
Returns:
Number of requests processed in this tick
- Type:
- number