QuadTree - Accessibility do and don'ts
I just finished writing a QuadTree. While it wasn't overly difficult, I'm still wondering a bit about giving access to the data.
Right now, I'm writing the function to access a node by it's position(This is C#),
ie T t = quadTree[10, 10];
However, should I allow the user of the tree allow direct access to nodes? Or just add functionality such as ForEach to just iterate ALL the data, or iterate the data within a specific zone.
Some feedback would be nice.
Toolmaker
It depends on the purpose I guess. If this is just part of some project, then you may as well just do whatever you need to for the project. If it is part of some library that may be used by other things then you may want to consider it, if you can see a real use for it.
I think that you're in more of a position to decide than anyone else at the moment. I would probably apply YAGNI
I think that you're in more of a position to decide than anyone else at the moment. I would probably apply YAGNI
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement