package com.swago.baseswago.model.live.pk

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

/**
 * 发起PK
 * actionType  1(发起PK) 2(发送方取消PK) 3(拒绝PK) 4(接受PK) 5(自动拒绝PK)
 */
data class SendPKModel (
    val senderId:String = "0",
    val senderName:String = "",
    val senderAvatar:String = "",
    val receiverId:String = "0",
    val receiverName:String = "",
    val receiverAvatar:String = "",
    val actionType:Int = 0
):Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readInt()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(senderId)
        parcel.writeString(senderName)
        parcel.writeString(senderAvatar)
        parcel.writeString(receiverId)
        parcel.writeString(receiverName)
        parcel.writeString(receiverAvatar)
        parcel.writeInt(actionType)
    }

    override fun describeContents(): Int {
        return 0
    }

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

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