1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
package io.dico.parcels2.util.math enum class Dimension { X, Y, Z; val otherDimensions get() = when (this) { X -> Y to Z Y -> X to Z Z -> X to Y } companion object { private val values = values() operator fun get(ordinal: Int) = values[ordinal] } }