Skip to content

Allow default boundary and capacity #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Dezzles
Copy link
Contributor

@Dezzles Dezzles commented Mar 1, 2019

Added support for a static withDefault() function that will attempt to pull defaults from global variables
Updated the visualize_qtree example to take advantage of this
Also updated dependencies to remove known security vulnerabilities (See commit messages)

@shiffman
Copy link
Member

shiffman commented Mar 1, 2019

What if we call this something like create(). I do like this thinking, I think p5 beginners are pretty used to overloading? What if we allow something like:

QuadTree.create(); // defaults but throws error message if no p5?
QuadTree.create(x, y, w, h); // boundary with default capacity
QuadTree.create(new Rectangle(x, y, w, h), capacity); // for someone who wants full customization?

And maybe we should namespace everything? QuadTree.Rectangle, QuadTree.Boundary, etc.? Maybe just qt. or qt5. for short?

Thank you so so much fo taking a look at this!

@Dezzles
Copy link
Contributor Author

Dezzles commented Mar 3, 2019

Made the updates to support multiple different create functions, getting to the point that I think some more solid documentation needs to get put together. I'll take a look at that later this week. Raised a new issue for the namespace item ( #38 )

Copy link
Member

@shiffman shiffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome, thank you!

@shiffman shiffman merged commit df98be7 into CodingTrain:master Mar 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants