diff --git a/build.gradle b/build.gradle index 829ef2b..f822886 100644 --- a/build.gradle +++ b/build.gradle @@ -39,7 +39,7 @@ publishing { release(MavenPublication) { groupId = 'org.team4099' artifactId = 'falconutils' - version = '1.1.8' + version = '1.1.9' from(components["kotlin"]) } diff --git a/src/main/kotlin/org/team4099/lib/units/Value.kt b/src/main/kotlin/org/team4099/lib/units/Value.kt index 14d49eb..aa3ef89 100644 --- a/src/main/kotlin/org/team4099/lib/units/Value.kt +++ b/src/main/kotlin/org/team4099/lib/units/Value.kt @@ -1,5 +1,6 @@ package org.team4099.lib.units +import java.util.function.Supplier import kotlin.math.absoluteValue import kotlin.math.sign @@ -20,6 +21,9 @@ value class Value(val value: Double) : Comparable> { inline val cubed: Value> get() = Value(value * value * value) + inline val asSupplier: Supplier> + get() = Supplier { Value(value) } + inline operator fun plus(o: Value): Value = Value(value + o.value) inline operator fun minus(o: Value): Value = Value(value - o.value)