Skip to content

Commit

Permalink
to public
Browse files Browse the repository at this point in the history
  • Loading branch information
FiLKoNd committed Dec 5, 2024
1 parent fc81353 commit 947077b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ import kotlin.reflect.KClass
import kotlin.reflect.full.createInstance

abstract class ConfigManager(
protected val folder: File,
val folder: File,
private val formatter: StringFormat
) {
val configs: MutableMap<File, Config> = mutableMapOf()

protected inline fun <reified T : Config> config(fileName: String): T {
inline fun <reified T : Config> config(fileName: String): T {
val file = File(folder, fileName)
return config(file, T::class)
}

protected fun <T : Config> config(file: File, clazz: KClass<T>): T {
fun <T : Config> config(file: File, clazz: KClass<T>): T {
val config = loadConfig(file, clazz)
configs[file] = config
return config
Expand Down

0 comments on commit 947077b

Please sign in to comment.