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
I have a use case where I would like one instance of Easystar to be invoked by many different objects. In such a case, it would be very handy to be able to pass the path callback function to the calculate() function instead of the constructor.
I realize that the callback function is also used in e.g. the setPath() function for signalling an invalid start or end position. However, I feel that this is a misuse of the callback. It might be an alternative to return a status code or throw an error on invalid input.
Thanks :)
The text was updated successfully, but these errors were encountered:
I have changed the API in 0.1.4. The callback is now added to the findPath method. Adding it to the calculate method would have been troublesome as you would have had to provide the callback each tick. There shouldn't be any need to duplicate world data anymore.
I have a use case where I would like one instance of Easystar to be invoked by many different objects. In such a case, it would be very handy to be able to pass the path callback function to the calculate() function instead of the constructor.
I realize that the callback function is also used in e.g. the setPath() function for signalling an invalid start or end position. However, I feel that this is a misuse of the callback. It might be an alternative to return a status code or throw an error on invalid input.
Thanks :)
The text was updated successfully, but these errors were encountered: