mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 10:34:06 +09:00
more pictogrammes
Former-commit-id: 670df70bbed466e56034dbdd33d7a1da31cd88d7 Former-commit-id: 2b106753155be6080d4651acca1981f10d614421
This commit is contained in:
38
src/net/torvald/serialise/ReadGameMapData.kt
Normal file
38
src/net/torvald/serialise/ReadGameMapData.kt
Normal file
@@ -0,0 +1,38 @@
|
||||
package net.torvald.serialise
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 16-08-24.
|
||||
*/
|
||||
object ReadGameMapData {
|
||||
|
||||
fun InputStream.readRelative(b: ByteArray, off: Int, len: Int): Int {
|
||||
if (b == null) {
|
||||
throw NullPointerException()
|
||||
} else if (off < 0 || len < 0 || len > b.size) {
|
||||
throw IndexOutOfBoundsException()
|
||||
} else if (len == 0) {
|
||||
return 0
|
||||
}
|
||||
|
||||
var c = read()
|
||||
if (c == -1) {
|
||||
return -1
|
||||
}
|
||||
b[0] = c.toByte()
|
||||
|
||||
var i = 1
|
||||
try {
|
||||
while (i < len) {
|
||||
c = read()
|
||||
if (c == -1) {
|
||||
break
|
||||
}
|
||||
b[i] = c.toByte()
|
||||
i++
|
||||
}
|
||||
} catch (ee: IOException) {
|
||||
}
|
||||
|
||||
return i
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package net.torvald.serialise
|
||||
|
||||
import net.torvald.terrarum.mapgenerator.MapGenerator
|
||||
import net.torvald.terrarum.mapgenerator.WorldGenerator
|
||||
import net.torvald.terrarum.mapgenerator.RoguelikeRandomiser
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.itemproperties.ItemPropCodex
|
||||
@@ -29,7 +29,7 @@ object WriteMeta {
|
||||
|
||||
val BYTE_NULL: Byte = 0
|
||||
|
||||
val terraseed: Long = MapGenerator.SEED
|
||||
val terraseed: Long = WorldGenerator.SEED
|
||||
val rogueseed: Long = RoguelikeRandomiser.seed
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user