package com.gh.gamecenter.entity

import android.os.Parcelable
import com.gh.common.filter.RegionSettingHelper
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.personalhome.home.UserHistoryViewModel
import com.google.gson.annotations.SerializedName
import kotlinx.parcelize.Parcelize

@Parcelize
data class SearchSubjectEntity(
    val name: String = "",
    var games: List<GameEntity> = listOf(),
    val location: Int = 0,
    @SerializedName("column_id")
    val columnId: String = "",
    val adId: String = "", // 广告ID(本地字段)，不为空时为广告专题
    val codeId: String = "", // 广告CODE_ID(本地字段)，不为空时为广告专题
    @SerializedName("ad_icon_active")
    val adIconActive: Boolean = false,
    // 本地字段，标记是否为微信小游戏CPM专题
    var isWGameSubjectCPM: Boolean = false,
    // 本地字段，标记是否为DSP专题
    var isDspSubject: Boolean = false,
    val type: String = "",

    @SerializedName("column_type")
    val columnType: String = "", // DSP 专题类型 (DSP专题类型（apk：下载应用、mini_game：微信小程序/小游戏）
    @SerializedName("show_download") // 下载/秒玩按钮（true：显示、false：不显示）（专题类型为apk，则为下载按钮；专题类型为mini_game，则为秒完按钮）
    val showDownload: Boolean = false,
    val size: Int = -1, // 专题游戏数量
) : Parcelable {

    companion object {
        const val TYPE_WECHAT_GAME_CPM_COLUMN = "wechat_game_cpm_column"
        const val TYPE_DSP_GAME_COLUMN = "dsp_game_column"
    }

    fun getFilterGame() = RegionSettingHelper.filterGame(games)
}