PhysicalConnectivity/src/main/kotlin/net/shadowfacts/phycon/util/RedstoneMode.kt

31 lines
574 B
Kotlin

package net.shadowfacts.phycon.util
import net.minecraft.text.Text
import net.minecraft.text.TranslatableText
/**
* @author shadowfacts
*/
enum class RedstoneMode: RotatableEnum, FriendlyNameable {
HIGH,
LOW,
TOGGLE,
RISING_EDGE,
FALLING_EDGE;
val isDiscrete: Boolean
get() = when (this) {
TOGGLE, RISING_EDGE, FALLING_EDGE -> true
else -> false
}
val isContinuous: Boolean
get() = when (this) {
HIGH, LOW -> true
else -> false
}
override val friendlyName: Text
get() = TranslatableText("gui.phycon.redstone_mode.${name.lowercase()}")
}