still working on the new savegame scheme

main game works fine, saving/loading will not be possible
This commit is contained in:
minjaesong
2021-10-07 17:43:23 +09:00
parent 6d8a7520ac
commit 3f9b41fd29
23 changed files with 200 additions and 86 deletions

View File

@@ -250,6 +250,7 @@ removefile:
}
}
override fun getEntry(id: EntryID) = requestFile(id)
override fun getFile(id: EntryID) = requestFile(id)?.contents as? EntryFile
/**

View File

@@ -4,5 +4,6 @@ package net.torvald.terrarum.tvda
* Created by minjaesong on 2021-10-07.
*/
interface SimpleFileSystem {
fun getEntry(id: EntryID): DiskEntry?
fun getFile(id: EntryID): EntryFile?
}

View File

@@ -143,6 +143,7 @@ class VirtualDisk(
extraInfoBytes = footer.toByteArray()
}
override fun getEntry(id: EntryID) = entries[id]
override fun getFile(id: EntryID) = try { VDUtil.getAsNormalFile(this, id) } catch (e: NullPointerException) { null }
private fun serializeEntriesOnly(): ByteArray64 {