Extract interface from implementation in case of Environment and ModuleRegistry
This commit is contained in:
@@ -3,18 +3,7 @@ package io.smnp.environment
|
||||
import io.smnp.ext.ModuleRegistry
|
||||
import io.smnp.type.module.Module
|
||||
|
||||
class Environment {
|
||||
private val rootModule = Module("<root>")
|
||||
private val loadedModules = mutableListOf<String>()
|
||||
|
||||
fun loadModule(path: String) {
|
||||
ModuleRegistry.requestModulesForPath(path).forEach {
|
||||
rootModule.addSubmodule(it)
|
||||
loadedModules.add(path)
|
||||
}
|
||||
}
|
||||
|
||||
fun printModules(printContent: Boolean) {
|
||||
rootModule.pretty(printContent)
|
||||
}
|
||||
interface Environment {
|
||||
fun loadModule(path: String)
|
||||
fun printModules(printContent: Boolean)
|
||||
}
|
||||
Reference in New Issue
Block a user