Skip to content

Commit

Permalink
Make addPoints in Shape and List accept a collection of points as well
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed Jul 15, 2023
1 parent 7776c8e commit f398e7a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/de/bluecolored/bluemap/api/math/Line.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@ public Builder addPoints(Vector3d... points) {
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}.
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/de/bluecolored/bluemap/api/math/Shape.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,16 @@ public Builder addPoints(Vector2d... points) {
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}.
Expand Down

0 comments on commit f398e7a

Please sign in to comment.