diff --git a/src/main/kotlin/net/trivernis/chunkmaster/lib/shapes/Circle.kt b/src/main/kotlin/net/trivernis/chunkmaster/lib/shapes/Circle.kt index 19aa335..be03db5 100644 --- a/src/main/kotlin/net/trivernis/chunkmaster/lib/shapes/Circle.kt +++ b/src/main/kotlin/net/trivernis/chunkmaster/lib/shapes/Circle.kt @@ -28,12 +28,19 @@ class Circle(center: Pair, start: Pair, radius: Int): Shape( return r } + /** + * Returns the edge locations of the shape to be used + * with dynmap markers + */ override fun getShapeEdgeLocations(): List> { val locations = this.getCircleCoordinates(this.radius) locations.add(locations.first()) return locations.map{ Pair(it.first + center.first, it.second + center.second) } } + /** + * Returns the next coordinate of the circle until the end is reached + */ override fun next(): Pair { if (endReached()) { return currentPos diff --git a/src/main/kotlin/net/trivernis/chunkmaster/lib/shapes/Spiral.kt b/src/main/kotlin/net/trivernis/chunkmaster/lib/shapes/Spiral.kt index 47afefb..75ee564 100644 --- a/src/main/kotlin/net/trivernis/chunkmaster/lib/shapes/Spiral.kt +++ b/src/main/kotlin/net/trivernis/chunkmaster/lib/shapes/Spiral.kt @@ -69,6 +69,9 @@ class Spiral(center: Pair, start: Pair, radius: Int): Shape( return currentPos } + /** + * Returns the edges to be used with dynmap markers + */ override fun getShapeEdgeLocations(): List> { val a = Pair(this.radius + center.first, this.radius + center.second) val b = Pair(this.radius + center.first, -this.radius + center.second)