mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 11:04:05 +09:00
serialisation of the world is split into two packages: complex one is moved under the modulebasegame package
This commit is contained in:
@@ -2,6 +2,7 @@ package net.torvald.terrarum.gameworld
|
||||
|
||||
import com.badlogic.gdx.utils.Disposable
|
||||
import net.torvald.terrarum.App.printdbg
|
||||
import net.torvald.terrarum.serialise.toUint
|
||||
import net.torvald.unsafe.UnsafeHelper
|
||||
import net.torvald.unsafe.UnsafePtr
|
||||
|
||||
@@ -107,5 +108,3 @@ open class BlockLayer(val width: Int, val height: Int) : Disposable {
|
||||
@Transient val BYTES_PER_BLOCK = 2L
|
||||
}
|
||||
}
|
||||
|
||||
fun Byte.toUint() = java.lang.Byte.toUnsignedInt(this)
|
||||
|
||||
@@ -32,9 +32,9 @@ class PhysicalStatus() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Special version of GameWorld where layer data are not transient
|
||||
* Special version of GameWorld where everything, including layer data, are saved in a single JSON file (i.e. not chunked)
|
||||
*/
|
||||
class GameWorldTitleScreen : GameWorld() {
|
||||
class SimpleGameWorld : GameWorld() {
|
||||
override lateinit var layerWall: BlockLayer
|
||||
override lateinit var layerTerrain: BlockLayer
|
||||
}
|
||||
@@ -128,7 +128,7 @@ open class GameWorld() : Disposable {
|
||||
|
||||
val extraFields = HashMap<String, Any?>()
|
||||
|
||||
// internal var genver = -1 // only gets used when the game saves and loads
|
||||
// NOTE: genver was here but removed: genver will be written by manually editing the serialising JSON. Reason: the 'genver' string must be found on a fixed offset on the file.
|
||||
internal var comp = -1 // only gets used when the game saves and loads
|
||||
|
||||
internal val dynamicItemInventory = ItemTable()
|
||||
|
||||
Reference in New Issue
Block a user