package com.gh.gamecenter.gamedetail.entity

import androidx.annotation.Keep
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.entity.*
import com.gh.gamecenter.feature.entity.*
import com.google.gson.annotations.SerializedName

@Keep
class NewGameDetailEntity(
    @SerializedName("show_comment")
    var showComment: Boolean = false,//游戏评论开关
    @SerializedName("direct_comment")
    var directComment: Boolean = false,//安装游戏才能评论
    var star: Float = 0f,
    @SerializedName("comment_count")
    var commentCount: Int = 0,
    var ranking: Ranking? = null,// 游戏榜单排名，无排名时，字段不存在
    @SerializedName("top_video")
    var topVideo: Video? = null,
    @SerializedName("me")
    var me: MeEntity = MeEntity(),
    var event: BigEvent? = null,//游戏大事件
    @SerializedName("detail_dialogs")
    var detailDialogs: ArrayList<GameEntity.Dialog> = arrayListOf(),
    @SerializedName("new_tag_style")
    var tagStyle: ArrayList<TagStyleEntity> = ArrayList(),
    @SerializedName("detail_tab")
    var detailEntity: ArrayList<DetailEntity> = ArrayList(),
    @SerializedName("zone_tab")
    var zone: ZoneEntity? = null,
    @SerializedName("appointment_switch_status")
    var appointmentSwitchStatus: Boolean = false,
    @SerializedName("recommend_age")
    var recommendAge: String = "",//适龄等级
    @SerializedName("_seq")
    val shortId: String = "",

    @SerializedName("mirror_status")
    var mirrorStatus: String? = "",
    @SerializedName("mirror_data")
    var mirrorData: DetailEntity? = null,
    @SerializedName("mirror_status2")
    var mirrorStatus2: String? = "",
    @SerializedName("mirror_data2")
    var mirrorData2: DetailEntity? = null,
    @SerializedName("bbs_tab")
    var bbsTab: LinkEntity? = null,
    @SerializedName("certification_tag")
    var certificateTag: Screenshot? = null,
    @SerializedName("content_card")
    var contentCard: ArrayList<ContentCardEntity> = ArrayList(),

    @SerializedName("smooth_relation_game")
    var smoothRelatedGame: SimpleGame? = null,

    @SerializedName("show_archive")
    var showArchive: Boolean = false, //云存档开关
    @SerializedName("archive_tab")
    var archiveTab: ArchiveTab = ArchiveTab()
) {
    fun isShowContentCard(gameEntity: GameEntity?): Boolean {
        return contentCard.size > 1 && (gameEntity?.shouldUseMirrorInfo() == false || (gameEntity?.shouldUseMirrorInfo() == true && mirrorData?.contentCardStatus == "on"))
    }
}

@Keep
class Ranking(
    @SerializedName("collection_id")
    var collectionId: String = "",//合集id
    @SerializedName("collection_name")
    var collectionName: String = "",//合集名称
    @SerializedName("column_id")
    var columnId: String = "",//专题id
    @SerializedName("column_name")
    var columnName: String = "",// 专题标题
    var no: String = ""// 排名名次
)

@Keep
class BigEvent(
    var time: Long = 0,
    var content: String = "",
    @SerializedName("high_light")
    var highLight: Boolean = false,
    var link: LinkEntity? = null
)

@Keep
class Screenshot(var screenshot: String = "")

@Keep
class ArchiveTab(@SerializedName("config_url") var configUrl: String = "")


