Skip to content

Commit 39b6425

Browse files
committed
add new constructor
1 parent f6e7814 commit 39b6425

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/main/java/com/github/mittyrobotics/pathfollowing/QuinticHermiteSplineGroup.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
public class QuinticHermiteSplineGroup extends Parametric {
66

77
//list of splines
8-
ArrayList<QuinticHermiteSpline> splines = new ArrayList<>();
8+
private ArrayList<QuinticHermiteSpline> splines = new ArrayList<>();
99

1010
/**
1111
* Creates a new spline group with an initial {@link QuinticHermiteSpline}
@@ -16,6 +16,17 @@ public QuinticHermiteSplineGroup(QuinticHermiteSpline initialSpline) {
1616
splines.add(initialSpline);
1717
}
1818

19+
/**
20+
* Creates a new spline group with an initial {@link ArrayList} of {@link QuinticHermiteSpline}s
21+
* @param splines initial {@link ArrayList} of {@link QuinticHermiteSpline}s
22+
*/
23+
public QuinticHermiteSplineGroup(ArrayList<QuinticHermiteSpline> splines) {
24+
this.splines = splines;
25+
for(QuinticHermiteSpline spline : splines) {
26+
length += spline.getLength();
27+
}
28+
}
29+
1930
/**
2031
* Creates a new empty spline group
2132
*/

0 commit comments

Comments
 (0)