package net.taehui.twilight

class NetItem(val avatarID: String, val avatarName: String) {
    companion object {
        const val STAND_MODE = 0
        const val POINT_MODE = 1
        const val BAND_MODE = 2
    }

    var stand = 0
    var highestBand = 0
    var point = 1.0
    var avatarNetStatus = EventOuterClass.Event.AvatarNetStatus.Default
    var hitPoints = 0.0
    var failed = false
    var lastJudged = 0
    var drawings: Collection<EventOuterClass.Event.NetDrawing> = emptyList()
    var drawingComponent: EventOuterClass.Event.DrawingComponent = EventOuterClass.Event.DrawingComponent.getDefaultInstance()
    var comment: CommentOuterClass.Comment? = null
    var title = ""
    var artist = ""
    var genre = ""
    var level = 0
    var levelText = ""
    var wantLevelID = ""
    var autoMode = 0
    var noteSaltMode = 0
    var audioMultiplier = 0.0
    var faintNoteMode = 0
    var hitPointsMode = 0
    var judgmentMode = 0
    var noteMobilityMode = 0
    var inputFavorMode = 0
    var longNoteMode = 0
    var noteModifyMode = 0
    var bpmMode = 0
    var waveMode = 0
    var setNoteMode = 0
    var lowestJudgmentConditionMode = 0
    var totalNotes = 0
    var judgmentStage = 0.0
    var hitPointsValue = 0.0
    var highestInputCount = 0
    var length = 0.0
    var bpm = 0.0
    var multiplier = 0.0
    var inputMode = Component.InputMode.INPUT_MODE_5_1
    var highestJudgment0 = -1.0
    var higherJudgment0 = -1.0
    var highJudgment0 = -1.0
    var lowJudgment0 = -1.0
    var lowerJudgment0 = -1.0
    var lowestJudgment0 = -1.0
    var highestJudgment1 = 1.0
    var higherJudgment1 = 1.0
    var highJudgment1 = 1.0
    var lowJudgment1 = 1.0
    var lowerJudgment1 = 1.0
    var lowestJudgment1 = 1.0

    fun setValues(qwilightCallNet: EventOuterClass.Event.QwilightCallNet, comment: CommentOuterClass.Comment?) {
        stand = qwilightCallNet.stand
        highestBand = qwilightCallNet.highestBand
        point = qwilightCallNet.point
        hitPoints = qwilightCallNet.hitPoints
        failed = qwilightCallNet.isFailed
        lastJudged = qwilightCallNet.lastJudged
        drawings = qwilightCallNet.drawingsList
        drawingComponent = qwilightCallNet.drawingComponent
        this.comment = comment
        title = qwilightCallNet.title
        artist = qwilightCallNet.artist
        genre = qwilightCallNet.genre
        level = qwilightCallNet.level
        levelText = qwilightCallNet.levelText
        wantLevelID = qwilightCallNet.wantLevelID
        autoMode = qwilightCallNet.autoMode
        noteSaltMode = qwilightCallNet.noteSaltMode
        audioMultiplier = qwilightCallNet.audioMultiplier
        faintNoteMode = qwilightCallNet.faintNoteMode
        hitPointsMode = qwilightCallNet.hitPointsMode
        judgmentMode = qwilightCallNet.judgmentMode
        noteMobilityMode = qwilightCallNet.noteMobilityMode
        inputFavorMode = qwilightCallNet.inputFavorMode
        longNoteMode = qwilightCallNet.longNoteMode
        noteModifyMode = qwilightCallNet.noteModifyMode
        bpmMode = qwilightCallNet.bpmMode
        waveMode = qwilightCallNet.waveMode
        setNoteMode = qwilightCallNet.setNoteMode
        lowestJudgmentConditionMode = qwilightCallNet.lowestJudgmentConditionMode
        totalNotes = qwilightCallNet.totalNotes
        judgmentStage = qwilightCallNet.judgmentStage
        hitPointsValue = qwilightCallNet.hitPointsValue
        highestInputCount = qwilightCallNet.highestInputCount
        length = qwilightCallNet.length
        bpm = qwilightCallNet.bpm
        multiplier = qwilightCallNet.multiplier
        inputMode = Component.InputMode.entries.elementAtOrElse(
            qwilightCallNet.inputMode - Component.InputMode.INPUT_MODE_4.value
        ) { Component.InputMode.INPUT_MODE_7_1 }
        highestJudgment0 = qwilightCallNet.highestJudgment0
        higherJudgment0 = qwilightCallNet.higherJudgment0
        highJudgment0 = qwilightCallNet.highJudgment0
        lowJudgment0 = qwilightCallNet.lowJudgment0
        lowerJudgment0 = qwilightCallNet.lowerJudgment0
        lowestJudgment0 = qwilightCallNet.lowestJudgment0
        highestJudgment1 = qwilightCallNet.highestJudgment1
        higherJudgment1 = qwilightCallNet.higherJudgment1
        highJudgment1 = qwilightCallNet.highJudgment1
        lowJudgment1 = qwilightCallNet.lowJudgment1
        lowerJudgment1 = qwilightCallNet.lowerJudgment1
        lowestJudgment1 = qwilightCallNet.lowestJudgment1
    }

    fun setFailed() {
        failed = false
    }
}