quicksave (part of the autosaving) is working

This commit is contained in:
minjaesong
2021-09-29 16:51:41 +09:00
parent f6eb567385
commit 60a8382f93
18 changed files with 283 additions and 42 deletions

View File

@@ -21,7 +21,9 @@ import org.khelekore.prtree.*
import java.io.File
import java.io.FileNotFoundException
import java.io.IOException
import java.util.*
import java.util.concurrent.locks.Lock
import kotlin.collections.ArrayList
/**
* Although the game (as product) can have infinitely many stages/planets/etc., those stages must be manually managed by YOU;
@@ -123,7 +125,7 @@ open class IngameInstance(val batch: SpriteBatch) : Screen {
val wallChangeQueue = ArrayList<BlockChangeQueueItem>()
val wireChangeQueue = ArrayList<BlockChangeQueueItem>() // if 'old' is set and 'new' is blank, it's a wire cutter
val modifiedChunks = Array(16) { HashSet<Int>() }
val modifiedChunks = Array(16) { TreeSet<Int>() }
internal var creationTime = App.getTIME_T() // cumulative value for the savegame
internal var lastPlayTime = App.getTIME_T() // cumulative value for the savegame
@@ -378,6 +380,8 @@ open class IngameInstance(val batch: SpriteBatch) : Screen {
} catch (e: NoSuchFileException) {}
}
fun getSaveFileMain() = File(App.defaultSaveDir, savegameNickname)
// simple euclidean norm, squared