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

31 lines
574 B
Kotlin
Raw Normal View History

2021-02-24 03:05:05 +00:00
package net.shadowfacts.phycon.util
2021-02-24 03:39:51 +00:00
import net.minecraft.text.Text
import net.minecraft.text.TranslatableText
2021-02-24 03:05:05 +00:00
/**
* @author shadowfacts
*/
2021-02-25 03:47:07 +00:00
enum class RedstoneMode: RotatableEnum, FriendlyNameable {
2021-02-24 03:05:05 +00:00
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
}
2021-02-24 03:39:51 +00:00
2021-02-25 03:47:07 +00:00
override val friendlyName: Text
2021-12-22 23:59:51 +00:00
get() = TranslatableText("gui.phycon.redstone_mode.${name.lowercase()}")
2021-02-24 03:05:05 +00:00
}