Skip to content

Commit f398e7a

Browse files
committed
Make addPoints in Shape and List accept a collection of points as well
1 parent 7776c8e commit f398e7a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/main/java/de/bluecolored/bluemap/api/math/Line.java

+10
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,16 @@ public Builder addPoints(Vector3d... points) {
160160
return this;
161161
}
162162

163+
/**
164+
* Adds multiple points to the end of line.
165+
* @param points the points to be added.
166+
* @return this builder for chaining
167+
*/
168+
public Builder addPoints(Collection<Vector3d> points) {
169+
this.points.addAll(points);
170+
return this;
171+
}
172+
163173
/**
164174
* Builds a new {@link Line} with the points set in this builder.<br>
165175
* There need to be at least 2 points to build a {@link Line}.

src/main/java/de/bluecolored/bluemap/api/math/Shape.java

+10
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,16 @@ public Builder addPoints(Vector2d... points) {
248248
return this;
249249
}
250250

251+
/**
252+
* Adds multiple points to the end of line.
253+
* @param points the points to be added.
254+
* @return this builder for chaining
255+
*/
256+
public Builder addPoints(Collection<Vector2d> points) {
257+
this.points.addAll(points);
258+
return this;
259+
}
260+
251261
/**
252262
* Builds a new {@link Shape} with the points set in this builder.<br>
253263
* There need to be at least 3 points to build a {@link Shape}.

0 commit comments

Comments
 (0)