roy-t / AStar

A fast 2D path finding library based on the A* algorithm. Works with both grids and graphs. Supports any .NET variant that supports .NETStandard 2.0 or higher. This library has no external dependencies. The library is licensed under the MIT license.
http://roy-t.nl
MIT License
340 stars 60 forks source link

Question: obstacles #49

Closed JamesPurvis closed 1 year ago

JamesPurvis commented 1 year ago

Hello,

This is probably a stupid question, but I have a project I'm working on where the grid obstacles change often and the grid map is shared with multiple agents. I don't want my agents to be able to walk through each other, so I need to be able to update my grid easily. I see there is an option to disconnect a node, which seems to make the position on the grid unusable, but is there anyway to add the same node back after you remove it?

roy-t commented 1 year ago

Hey James,

You can use the Grid.AddEdge method to add a connection between two points again :).

JamesPurvis commented 1 year ago

Wow! How didn't I see that thanks so much

roy-t commented 1 year ago

Haha it happens, no worries!


From: James Purvis @.> Sent: Thursday, December 15, 2022 3:25:40 PM To: roy-t/AStar @.> Cc: Roy Triesscheijn @.>; State change @.> Subject: Re: [roy-t/AStar] Question: obstacles (Issue #49)

Wow! How didn't I see that thanks so much

— Reply to this email directly, view it on GitHubhttps://github.com/roy-t/AStar/issues/49#issuecomment-1353176682, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAEYIEV2XTEROMZOS4YXWS3WNMS6JANCNFSM6AAAAAAS7NKFRI. You are receiving this because you modified the open/close state.Message ID: @.***>