Forgot to commit this

This commit is contained in:
DBotThePony 2024-04-26 15:01:27 +07:00
parent b0913d1522
commit a498c8704b
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 10 additions and 1 deletions

View File

@ -5,7 +5,6 @@ import ru.dbotthepony.kommons.util.Listenable
import ru.dbotthepony.kommons.util.ListenableDelegate
import java.io.DataInputStream
import java.io.DataOutputStream
import java.util.*
import java.util.function.Consumer
open class BasicNetworkedElement<TYPE, LEGACY>(private var value: TYPE, protected val codec: StreamCodec<TYPE>, protected val legacyCodec: StreamCodec<LEGACY>, protected val toLegacy: (TYPE) -> LEGACY, protected val fromLegacy: (LEGACY) -> TYPE) : NetworkedElement(), ListenableDelegate<TYPE> {
@ -31,6 +30,11 @@ open class BasicNetworkedElement<TYPE, LEGACY>(private var value: TYPE, protecte
return valueListeners.addListener(listener)
}
@Deprecated("Internal API")
override fun listen(listener: Runnable): Listenable.L {
return valueListeners.addListener(listener)
}
override fun get(): TYPE {
return value
}

View File

@ -105,6 +105,11 @@ class FloatingNetworkedElement(private var value: Double = 0.0, val ops: Ops, va
return valueListeners.addListener(listener)
}
@Deprecated("Internal API")
override fun listen(listener: Runnable): Listenable.L {
return valueListeners.addListener(listener)
}
override fun get(): Double {
return value
}