Skip to content

#6 curve builder#8

Open
richardTingle wants to merge 8 commits intoJeddic:masterfrom
richardTingle:#6_curveBuilder
Open

#6 curve builder#8
richardTingle wants to merge 8 commits intoJeddic:masterfrom
richardTingle:#6_curveBuilder

Conversation

@richardTingle
Copy link
Contributor

Adds a builder for curves that can be used like

 Curve curve = Curve.builder()
         .anchorPoint(new Vector2f(0,0))
         .anchorPoint(new Vector2f(0.5f,0.5f))
         .controlPoint1(new Vector2f(0.6f,0.5f))
         .controlPoint2(new Vector2f(0.8f,2f))
         .anchorPoint(new Vector2f(1,2f))
         .build();

The builder statically prevents end being called when not at an anchor, or controlPoint1 or controlPoint2 or nextAnchor being called at the wrong time

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.

1 participant