package moe.nea.firm import ext.StringIdentifiable import kotlin.enums.enumEntries abstract class ManagedConfig(val identifier: String) { protected fun option( propertyName: String, default: () -> T, // handler: OptionHandler ): ManagedOption { return TODO() } protected fun choice( propertyName: String, universe: List, codec: Codec, renderer: EnumRenderer, default: () -> E ): ManagedOption { return option(propertyName, default, // ChoiceHandler(universe, codec, renderer) ) } protected inline fun choice( propertyName: String, noinline default: () -> E ): ManagedOption where E : Enum, E : StringIdentifiable { return choice( propertyName, enumEntries().toList(), StringIdentifiable.createCodec { enumValues() }, EnumRenderer.default(), default ) } }