KStarbound/src/main/kotlin/ru/dbotthepony/kstarbound/defs/JumpProfile.kt
2024-02-03 20:41:51 +07:00

35 lines
1.1 KiB
Kotlin

package ru.dbotthepony.kstarbound.defs
import ru.dbotthepony.kstarbound.json.builder.JsonFactory
@JsonFactory
data class JumpProfile(
val jumpSpeed: Double? = null,
val jumpControlForce: Double? = null,
val jumpInitialPercentage: Double? = null,
val jumpHoldTime: Double? = null,
val jumpTotalHoldTime: Double? = null,
val multiJump: Boolean? = null,
val reJumpDelay: Double? = null,
val autoJump: Boolean? = null,
val collisionCancelled: Boolean? = null,
) {
fun merge(other: JumpProfile): JumpProfile {
return JumpProfile(
jumpSpeed = other.jumpSpeed ?: jumpSpeed,
jumpControlForce = other.jumpControlForce ?: jumpControlForce,
jumpInitialPercentage = other.jumpInitialPercentage ?: jumpInitialPercentage,
jumpHoldTime = other.jumpHoldTime ?: jumpHoldTime,
jumpTotalHoldTime = other.jumpTotalHoldTime ?: jumpTotalHoldTime,
multiJump = other.multiJump ?: multiJump,
reJumpDelay = other.reJumpDelay ?: reJumpDelay,
autoJump = other.autoJump ?: autoJump,
collisionCancelled = other.collisionCancelled ?: collisionCancelled,
)
}
companion object {
val EMPTY = JumpProfile()
}
}