package com.gh.gamecenter.feature.entity

import androidx.room.Entity
import androidx.room.PrimaryKey
import com.google.gson.annotations.SerializedName

@Entity
data class SimulatorGameRecordEntity(
    @PrimaryKey
    var id: String = "",
    var icon: String? = null,
    var iconSubscript: String? = null,
    var name: String? = null,
    var brief: String? = null,
    var tag: ArrayList<String>? = null,
    var isLibaoExist: Boolean = false,
    @SerializedName("tag_style")
    var tagStyle: ArrayList<TagStyleEntity> = ArrayList(),
    var orderTag: Long = 0,
    var des: String? = null,
    var apk: ArrayList<ApkEntity>? = null,
    @SerializedName("apk_normal")
    var apkNormal: ArrayList<ApkEntity>? = null,
    @SerializedName("simulator_type")
    var simulatorType: String = "",
    var simulator: SimulatorEntity? = null,
    var category: String = "",
    @SerializedName("is_recently_played")
    var isRecentlyPlayed: Boolean = false,
    var isDeleted: Boolean = false
) {

    fun convertSimulatorGameRecordEntityToGameEntity(): GameEntity {
        val gameEntity = GameEntity()
        gameEntity.id = id
        gameEntity.brief = brief
        gameEntity.des = des
        gameEntity.rawIcon = icon
        gameEntity.iconSubscript = iconSubscript
        gameEntity.name = name
        gameEntity.tagStyle = tagStyle
        gameEntity.simulatorType = simulatorType
        gameEntity.simulator = simulator
        gameEntity.category = category
        gameEntity.isRecentlyPlayed = isRecentlyPlayed
        gameEntity.setApk(apk)
        return gameEntity
    }
}