Make addPoints in Shape and List accept a collection of points as well

This commit is contained in:
Lukas Rieger (Blue) 2023-07-15 12:31:34 +02:00
parent 7776c8e979
commit f398e7ab2b
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2
2 changed files with 20 additions and 0 deletions

View File

@ -160,6 +160,16 @@ public class Line {
return this;
}
/**
* Adds multiple points to the end of line.
* @param points the points to be added.
* @return this builder for chaining
*/
public Builder addPoints(Collection<Vector3d> points) {
this.points.addAll(points);
return this;
}
/**
* Builds a new {@link Line} with the points set in this builder.<br>
* There need to be at least 2 points to build a {@link Line}.

View File

@ -248,6 +248,16 @@ public class Shape {
return this;
}
/**
* Adds multiple points to the end of line.
* @param points the points to be added.
* @return this builder for chaining
*/
public Builder addPoints(Collection<Vector2d> points) {
this.points.addAll(points);
return this;
}
/**
* Builds a new {@link Shape} with the points set in this builder.<br>
* There need to be at least 3 points to build a {@link Shape}.