feat(json): prepare support for layout saving/loading

This commit is contained in:
aro 2023-01-05 13:02:01 +01:00
parent c954901198
commit 34de9a79d8

View file

@ -2,12 +2,13 @@ package xyz.atnrch.wrench.watcher
import xyz.atnrch.wrench.logger.Logger
import java.io.File
import java.nio.file.Path
class WatcherManager(private val entries: MutableMap<Int, WatcherEntry>) {
private var currentId: Int = -1
fun addFile(file: File) {
val watcherEntry = WatcherEntry(file, arrayListOf())
fun addFile(file: File, outputs: ArrayList<Path>) {
val watcherEntry = WatcherEntry(file, outputs)
currentId += 1
entries[currentId] = watcherEntry
Logger.info(
@ -20,6 +21,10 @@ class WatcherManager(private val entries: MutableMap<Int, WatcherEntry>) {
)
}
fun addFile(file: File) {
addFile(file, arrayListOf())
}
fun removeFile(id: Int) {
entries.remove(id)
}