summaryrefslogtreecommitdiff
path: root/src/main/kotlin/io/dico/parcels2/util/math/Dimension.kt
blob: cf67148058e88ea696b959773c215e0b2fa378dc (plain)
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]
    }
}