- Home /
This post has been wikified, any user with enough reputation can edit it.
Question by
lordmonkey · Dec 18, 2012 at 12:14 AM ·
pathfindingdesignartificial intelligence
Should pathfinder in A* hold closedSet and openedSet or each object should hold its sets?
I am about to implement A* pathfinding algorithm and I wonder how should I implement this - from the point of view of architecture.
I have the pathfinder as a class - I think I will instantiate only one object of this class (or maybe make it a Singleton - this is not so important).
The hardest part for me is whether the `closedSet` and `openedSet` should be attached to objects that can find the path for them or should be stored in `pathfinder` class ?
I am opened to any hints and critique whatsoever.
What is the best practice considering pathfinding in terms of design ?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613085558im_/https://answers.unity.com/themes/thub/images/avi.jpg)