package ru.dbotthepony.mc.otm.menu.input

import ru.dbotthepony.kommons.util.Delegate
import ru.dbotthepony.mc.otm.menu.MatteryMenu
import kotlin.reflect.KMutableProperty0

class FloatInputWithFeedback(menu: MatteryMenu) : AbstractPlayerInputWithFeedback<Float>() {
	override val input = menu.floatInput { consumer?.invoke(it) }
	override val field = menu.mSynchronizer.computedFloat { supplier?.invoke() ?: 0f }

	constructor(menu: MatteryMenu, state: KMutableProperty0<Float>) : this(menu) {
		with(state)
	}

	constructor(menu: MatteryMenu, state: Delegate<Float>) : this(menu) {
		with(state)
	}
}
