Should pathfinder in A* hold closedSet and openedSet or each object should hold its sets?

Posted by Patryk on Game Development See other posts from Game Development or by Patryk
Published on 2012-12-18T08:59:07Z Indexed on 2012/12/18 11:13 UTC
Read the original article Hit count: 446

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 ?

© Game Development or respective owner

Related posts about game-design

Related posts about ai