Created
September 25, 2016 05:39
-
-
Save Jire/72159ac32778a25f86d8e42161ede08f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import it.unimi.dsi.fastutil.longs.Long2FloatArrayMap | |
| import org.jire.strukt.Strukt | |
| import kotlin.reflect.KProperty | |
| class FloatMember(private val default: Float) : Member() { | |
| private val current = Long2FloatArrayMap() | |
| operator fun getValue(ref: Strukt, prop: KProperty<*>) = current[key] | |
| operator fun setValue(ref: Strukt, prop: KProperty<*>, value: Float) { | |
| current[key] = value | |
| } | |
| override fun default() { | |
| current[key] = default | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment