33 lines
850 B
Kotlin
33 lines
850 B
Kotlin
package ru.dbotthepony.kstarbound.defs
|
|
|
|
import ru.dbotthepony.kstarbound.json.builder.IStringSerializable
|
|
import ru.dbotthepony.kstarbound.json.builder.JsonAlias
|
|
import ru.dbotthepony.kstarbound.json.builder.JsonFactory
|
|
|
|
@JsonFactory
|
|
data class PerlinNoiseParameters(
|
|
val type: Type = Type.PERLIN,
|
|
val seed: Long? = null,
|
|
val octaves: Int = 1,
|
|
val gain: Double = 2.0,
|
|
val offset: Double = 1.0,
|
|
val beta: Double = 1.0,
|
|
val alpha: Double = 2.0,
|
|
val frequency: Double = 1.0,
|
|
val amplitude: Double = 1.0,
|
|
val bias: Double = 0.0,
|
|
) {
|
|
enum class Type(override val jsonName: String) : IStringSerializable {
|
|
UNITIALIZED("uninitialized"),
|
|
PERLIN("perlin"),
|
|
BILLOW("billow"),
|
|
RIDGED_MULTI("ridgedMulti");
|
|
|
|
private val lower = jsonName.lowercase()
|
|
|
|
override fun match(name: String): Boolean {
|
|
return name.lowercase() == lower
|
|
}
|
|
}
|
|
}
|