package com.swago.baseswago.model.live.game

import android.os.Parcel
import android.os.Parcelable

/**
 *@date 2022/2/8 11:19
 *description:
 */
data class GameListModel(
    var game: List<GameModel>?,
)

data class GameModel(
    var game_api_url: String? = "",//游戏接口地址
    var game_icon_url: String? = "",//游戏图标
    var game_type: Int = -1, //游戏类型(1三张2水果机3slot 4庄模式)
    var game_url: String? = "",//游戏地址
    var game_version:Int = 0,//游戏版本
    var game_down_url:String? = "",//游戏下载地址
    var is_full_game:Int//游戏是否全屏
) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readInt()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(game_api_url)
        parcel.writeString(game_icon_url)
        parcel.writeInt(game_type)
        parcel.writeString(game_url)
        parcel.writeInt(game_version)
        parcel.writeString(game_down_url)
        parcel.writeInt(is_full_game)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<GameModel> {
        override fun createFromParcel(parcel: Parcel): GameModel {
            return GameModel(parcel)
        }

        override fun newArray(size: Int): Array<GameModel?> {
            return arrayOfNulls(size)
        }
    }
}