aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firm/ManagedConfig.kt
blob: 741d6aa48b68d301027d407bed7aaa13d1f0be98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package moe.nea.firm

import ext.StringIdentifiable
import kotlin.enums.enumEntries


abstract class ManagedConfig {
	protected fun <E : Any> choice(
		codec: Codec<E>,
		renderer: EnumRenderer<E>,
	) {}

	protected inline fun <reified E> choice(
	) where E : Enum<E>, E : StringIdentifiable {
		return choice(
			StringIdentifiable.createCodec { enumValues<E>() },
			EnumRenderer.default(),
		)
	}
}