package com.dowstats.data.entities.unit

import com.fasterxml.jackson.annotation.JsonIgnore
import jakarta.persistence.*

@Entity
@Table(name = "jumps")
class Jump {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    var id: Long? = null

    @ManyToOne
    @JoinColumn(name = "unit_id", nullable = false)
    @JsonIgnore
    var unit: DowUnit? = null

    var chargeRegeneration: Double? = null
    var goUpTime: Double? = null
    var jumpDistanceMax: Double? = null
    var breakdownTime: Double? = null
    var chargeJumpCostMin: Double? = null
    var jumpHeight: Double? = null
    var chargeMax: Double? = null
    var setupTime: Double? = null
    var chargeJumpCostMax: Double? = null
    var goDownTime: Double? = null
    var teleport: Boolean = false
    var jumpTimeMax: Double? = null
    var jumpTimeMin: Double? = null
    var jumpMinHeight: Double? = null

    @OneToMany(mappedBy = "jump", cascade = [CascadeType.ALL])
    var jumpRequirements: MutableSet<JumpRequirements> = mutableSetOf()
}
