package com.gh.gamecenter.feature.entity

import com.gh.gamecenter.common.entity.IconFloat
import com.google.gson.annotations.SerializedName

data class ServerCalendarGame(
    @SerializedName("_id")
    val id: String = "",
    val name: String = "",
    val category: String = "",
    val brief: String = "",
    val icon: String = "",
    @SerializedName("ori_icon")
    val oriIcon: String? = null,
    @SerializedName("mirror_status")
    val mirrorStatus: String = "off",
    @SerializedName("_seq")
    val seq: Int = 0,
    @SerializedName("icon_float")
    val iconFloat: IconFloat? = null,
    @SerializedName("mirror_status2")
    val mirrorStatus2: String = "off",
    @SerializedName("icon_subscript")
    var iconSubscript: String = "",
    var subtitle: String? = "",
    @SerializedName("subtitle_style")
    var subtitleStyle: TagStyleEntity? = null,
    val servers: List<ServerCalendarEntity> = emptyList(),
    @SerializedName("servers_total")
    val serversTotal: Int = 0,
    @SerializedName("notify_status")
    val notifyStatus: String? = null //todo 待提醒 coming 即将开服 opened 已开服 has_new 有新服 expired 已过期
) {

    var startMidnight: Long = 0

    fun toGameEntity(): GameEntity {
        val gameEntity = GameEntity(id = id, name = name)
        gameEntity.sequence = seq
        gameEntity.icon = icon
        gameEntity.rawIcon = oriIcon
        gameEntity.iconSubscript = iconSubscript
        gameEntity.mirrorStatus = mirrorStatus
        gameEntity.mirrorStatus2 = mirrorStatus2
        gameEntity.subtitle = subtitle ?: ""
        gameEntity.subtitleStyle = subtitleStyle
        gameEntity.iconFloat = iconFloat
        gameEntity.brief = brief
        gameEntity.category = category
        return gameEntity
    }
}