Sign in to follow this  
Toolmaker

QuadTree - Accessibility do and don'ts

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this