Skip to content
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

apply builder pattern #7

Open
ConnyOnny opened this issue Feb 1, 2017 · 0 comments
Open

apply builder pattern #7

ConnyOnny opened this issue Feb 1, 2017 · 0 comments

Comments

@ConnyOnny
Copy link

The Builder is currently a collection of constructors for Generator. To facilitate adding more configuration options (like defining a perimeter #4), the Builder Pattern should be applied.

That means the Builder should first be constructed with a new() function with no arguments and further configuration should be applied to the Builder object before the build function is used.

Example:

Builder::<_, Vec2>::new().with_poisson_type(Type::Normal).with_radius(0.1)

The required refactoring is also a good opportunity to replace assert! in the Builder by returning an error, to avoid crashing the whole program.

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

No branches or pull requests

1 participant