package ru.dbotthepony.mc.otm.menu.tech

import net.minecraft.world.entity.player.Inventory
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleGeneratorBlockEntity
import ru.dbotthepony.mc.otm.core.multiblock.MultiblockStatus
import ru.dbotthepony.mc.otm.menu.MatteryMenu
import ru.dbotthepony.mc.otm.menu.input.BooleanInputWithFeedback
import ru.dbotthepony.mc.otm.menu.input.DecimalInputWithFeedback
import ru.dbotthepony.mc.otm.menu.input.EnumInputWithFeedback
import ru.dbotthepony.mc.otm.menu.widget.CombinedProfiledLevelGaugeWidget
import ru.dbotthepony.mc.otm.registry.game.MMenus
import java.util.function.BooleanSupplier

class BlackHoleGeneratorMenu(
	p_38852_: Int,
	inventory: Inventory,
	tile: BlackHoleGeneratorBlockEntity? = null,
) : MatteryMenu(MMenus.BLACK_HOLE_GENERATOR, p_38852_, inventory, tile) {
	val formed = mSynchronizer.computedBoolean(BooleanSupplier { tile?.multiblock?.isValid == MultiblockStatus.VALID })
	val drawBuildingGuide = BooleanInputWithFeedback(this, tile?.let { it::drawBuildingGuide })
	val energy = CombinedProfiledLevelGaugeWidget(this, tile?.energy)
	val matter = CombinedProfiledLevelGaugeWidget(this, tile?.matter)
	val injectionRate = DecimalInputWithFeedback(this, tile?.let { it::injectionRate })
	val targetMass = DecimalInputWithFeedback(this, tile?.let { it::targetMass })
	val mode = EnumInputWithFeedback(this, tile?.let { it::mode })
	val redstoneConfig = EnumInputWithFeedback(this, tile?.let { it.redstoneControl::redstoneSetting })
}
