Compare commits
2 Commits
e913874ace
...
df800f05f0
Author | SHA1 | Date | |
---|---|---|---|
df800f05f0 | |||
|
498db37a7c |
@ -179,6 +179,10 @@ public fun CircleTrajectory2D(
|
|||||||
@Serializable
|
@Serializable
|
||||||
@SerialName("composite")
|
@SerialName("composite")
|
||||||
public class CompositeTrajectory2D(public val segments: List<Trajectory2D>) : Trajectory2D {
|
public class CompositeTrajectory2D(public val segments: List<Trajectory2D>) : Trajectory2D {
|
||||||
|
init {
|
||||||
|
require(segments.isNotEmpty()) { "A composite trajectory cannot consist of an empty list of trajectories" }
|
||||||
|
}
|
||||||
|
|
||||||
override val length: Double get() = segments.sumOf { it.length }
|
override val length: Double get() = segments.sumOf { it.length }
|
||||||
|
|
||||||
override val beginPose: Pose2D get() = segments.first().beginPose
|
override val beginPose: Pose2D get() = segments.first().beginPose
|
||||||
|
Loading…
Reference in New Issue
Block a user