File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
common/src/main/kotlin/com/lambda/interaction/request/rotating/visibilty Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -22,17 +22,17 @@ import com.lambda.interaction.request.rotating.RotationManager
2222import com.lambda.util.math.distSq
2323import com.lambda.util.math.times
2424
25- enum class PointSelection (val select : (MutableList <VisibilityChecker .CheckedHit >) -> VisibilityChecker .CheckedHit ? ) {
25+ enum class PointSelection (val select : (Collection <VisibilityChecker .CheckedHit >) -> VisibilityChecker .CheckedHit ? ) {
2626 ByRotation ({ hits ->
2727 hits.minByOrNull {
2828 RotationManager .activeRotation dist it.targetRotation
2929 }
3030 }),
3131 Optimum ({ hits ->
3232 val optimum = hits
33- .map { it.hit.pos }
34- .reduceOrNull { acc, pos -> pos?. let { acc? .add(it) } }
35- ?.times(1 / hits.size)
33+ .mapNotNull { it.hit.pos }
34+ .reduceOrNull { acc, pos -> acc.add(pos) }
35+ ?.times(1 / hits.size.toDouble() )
3636
3737 optimum?.let {
3838 hits.minByOrNull { it.hit.pos distSq optimum }
You can’t perform that action at this time.
0 commit comments