package ru.dbotthepony.mc.otm.menu.storage

import net.minecraft.world.entity.player.Inventory
import ru.dbotthepony.mc.otm.block.entity.storage.AbstractStorageImportExport
import ru.dbotthepony.mc.otm.menu.MatteryPoweredMenu
import ru.dbotthepony.mc.otm.menu.input.BooleanInputWithFeedback
import ru.dbotthepony.mc.otm.menu.input.EnergyConfigPlayerInput
import ru.dbotthepony.mc.otm.menu.widget.ProfiledLevelGaugeWidget
import ru.dbotthepony.mc.otm.registry.MMenus

class StorageImporterExporterMenu(
	containerId: Int, inventory: Inventory, tile: AbstractStorageImportExport? = null
) : MatteryPoweredMenu(MMenus.STORAGE_IMPORTER_EXPORTER, containerId, inventory, tile)  {
	val filterSlots = addFilterSlots(tile?.filter, AbstractStorageImportExport.MAX_FILTERS)
	val isWhitelist = BooleanInputWithFeedback(this, tile?.let { it.filter::isWhitelist })
	val matchNBT = BooleanInputWithFeedback(this, tile?.let { it.filter::matchNBT })
	val matchTag = BooleanInputWithFeedback(this, tile?.let { it.filter::matchTag })
	val profiledEnergy = ProfiledLevelGaugeWidget(this, tile?.energy, energyWidget)
	val energyConfig = EnergyConfigPlayerInput(this, tile?.energyConfig)

	init {
		addInventorySlots()
	}
}
