KStarbound/src/main/kotlin/ru/dbotthepony/kstarbound/player/QuestDescriptor.kt

19 lines
442 B
Kotlin

package ru.dbotthepony.kstarbound.player
import com.google.gson.JsonObject
import ru.dbotthepony.kstarbound.io.json.builder.JsonFactory
@JsonFactory
data class QuestDescriptor(
val questId: String,
val templateId: String = questId,
val seed: Long = makeSeed(),
val parameters: JsonObject = JsonObject()
) {
companion object {
fun makeSeed(): Long {
return System.nanoTime().rotateLeft(27).xor(System.currentTimeMillis())
}
}
}