Applied kotlin style conventions

This commit is contained in:
bluefireoly
2020-10-18 18:36:49 +02:00
parent e1d4e8bbfc
commit da848728d2
39 changed files with 509 additions and 385 deletions

View File

@@ -55,8 +55,16 @@ abstract class Circle(val radius: Number) {
while (currentRadius >= 0) {
this += circleEdgeLocations(currentRadius).mapTo(HashSet()) {
mutableSetOf(it).apply {
this += SimpleLocation2D(it.x + when { it.x >= 1 -> -1; it.x <= -1 -> 1; else -> 0 }, it.y)
this += SimpleLocation2D(it.x, it.y + when { it.y >= 1 -> -1; it.y <= -1 -> 1; else -> 0 })
this += SimpleLocation2D(
it.x + when {
it.x >= 1 -> -1; it.x <= -1 -> 1; else -> 0
}, it.y
)
this += SimpleLocation2D(
it.x, it.y + when {
it.y >= 1 -> -1; it.y <= -1 -> 1; else -> 0
}
)
}
}.flatten()
currentRadius--