package com.gh.gamecenter.gamedetail.entity

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

@Keep
class ContentCardEntity(
    @SerializedName("_id")
    var id: String = "",
    var name: String? = "", // tag
    var title: String? = "",
    var image: String? = "",
    @SerializedName("target", alternate = ["link", "link_id"])
    var link: String? = "",
    @SerializedName("type", alternate = ["link_type"])
    var type: String? = "",
    var icon: String = "",
    @SerializedName("game_icon")
    var gameIcon: String? = "",
    @SerializedName("game_icon_subscript")
    var gameIconSubscript: String? = "",
    var text: String? = "",
    @SerializedName("link_text")
    var linkText: String? = "",//游戏详情弹窗，兼容旧版本用
    var value: String? = "",
    @SerializedName("community_id")
    var communityId: String? = "",
    @SerializedName("link_community", alternate = ["community"])
    var community: CommunityEntity? = CommunityEntity(),
    var display: Display? = null, // 板块
    @SerializedName("close_button")
    var closeButton: String = "open",//用户判断h5游戏关闭按钮是否显示，hide(隐藏)、open(开启)
    @SerializedName("button_link")
    var buttonLink: Boolean = false,
    @SerializedName("activity_id")
    var activityId: String = "",
    var style: String = "",

    var des: String = "",
    var server: GameDetailServer? = null,
    @SerializedName("mirror_server")
    var mirrorServer: GameDetailServer? = null,
    var libao: LibaoEntity? = null,
    @SerializedName("zone_tab")
    var zoneTab: Boolean = false,
    @SerializedName("related_version")
    var relatedVersion: Boolean = false,
    var toolkit: ArrayList<ToolBoxEntity> = ArrayList(),
    @SerializedName("func_bbs")
    val funcBbs: LinkEntity? = null
) {
    fun toLinkEntity(): LinkEntity {
        return LinkEntity(
            name = name,
            title = title,
            image = image,
            link = link,
            type = type,
            icon = icon,
            gameIcon = gameIcon,
            gameIconSubscript = gameIconSubscript,
            text = text,
            linkText = linkText,
            value = value,
            communityId = communityId,
            community = community,
            display = display,
            closeButton = closeButton,
            buttonLink = buttonLink,
            activityId = activityId,
            style = style
        )
    }
}
