Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter and algorithm should be made optional. #10

Closed
shixish opened this issue Mar 19, 2016 · 1 comment
Closed

filter and algorithm should be made optional. #10

shixish opened this issue Mar 19, 2016 · 1 comment

Comments

@shixish
Copy link

shixish commented Mar 19, 2016

I added the question marks (?) to the opts object. This was causing my code to throw errors since I was only using filter and not specifying the algorithm (using the default).

    /**
     * Find an object with the shortest path from the given position. Uses A* search algorithm and Dijkstra's algorithm.
     * @param type See Room.find
     * @param opts An object containing pathfinding options (see Room.findPath), or one of the following: filter, algorithm
     */
    findClosestByPath<T>(type: number, opts?: {
        filter?: any | string;
        algorithm?: string;
    }): T;
    /**
     * Find an object with the shortest path from the given position. Uses A* search algorithm and Dijkstra's algorithm.
     * @param objects An array of room's objects or RoomPosition objects that the search should be executed against.
     * @param opts An object containing pathfinding options (see Room.findPath), or one of the following: filter, algorithm
     */
    findClosestByPath<T>(objects: [T | RoomPosition], opts?: {
        filter?: any | string;
        algorithm?: string;
    }): T;
@MarkoSulamagi
Copy link
Collaborator

I also found some other methods where this was the case. Fixed it and released new version.
Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants