feat(json): prepare support for layout saving/loading
This commit is contained in:
parent
c954901198
commit
34de9a79d8
1 changed files with 7 additions and 2 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Reference in a new issue