watchdog interval is now a constructor arg

This commit is contained in:
minjaesong
2022-12-28 05:02:03 +09:00
parent 3282faf9e6
commit 4792d1d349

View File

@@ -6,12 +6,12 @@ import net.torvald.terrarum.modulecomputers.virtualcomputer.tvd.VirtualDisk
import java.io.File import java.io.File
/** /**
* @param interval Seconds between sleep
*
* Created by minjaesong on 2022-12-18. * Created by minjaesong on 2022-12-18.
*/ */
abstract class VMWatchdog { abstract class VMWatchdog(val interval: Float) {
/** Seconds between sleep */
abstract val interval: Float
protected var akku = 0f protected var akku = 0f
open fun update(delta: Float) { open fun update(delta: Float) {
@@ -29,8 +29,7 @@ abstract class VMWatchdog {
} }
object TevdSyncWatchdog : VMWatchdog() { object TevdSyncWatchdog : VMWatchdog(5f) {
override val interval = 5f
private val messageQueue = ArrayList<Pair<File, VirtualDisk>>() private val messageQueue = ArrayList<Pair<File, VirtualDisk>>()