package com.genlot.nativesdk.model;

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

import java.util.ArrayList;

public class GameWinBulletin implements Parcelable {
    public int mGameID;//游戏ID
    public long mGameIssue;//游戏期号
    public String mGameName;//游戏名称
    public double mAllSales;//总销量
    public int[] mWinNumber;//开奖号码
    public ArrayList<GameWinPool> mWinPool;//奖池信息
    public ArrayList<GameWinLevel> mWinLevel;//中奖明细

    public GameWinBulletin() {
        mGameID = 0;
        mGameIssue = 0;
        mGameName = "";
        mWinNumber = new int[256];
        mWinPool = new ArrayList<>();
        mWinLevel = new ArrayList<>();
    }

    public static final Creator<GameWinBulletin> CREATOR = new Creator<GameWinBulletin>() {
        @Override
        public GameWinBulletin createFromParcel(Parcel source) {
            GameWinBulletin attr = new GameWinBulletin();
            attr.mGameID = source.readInt();
            attr.mGameIssue = source.readLong();
            attr.mGameName = source.readString();
            attr.mAllSales = source.readDouble();
            source.readIntArray(attr.mWinNumber);
            source.readTypedList(attr.mWinPool, GameWinPool.CREATOR);
            source.readTypedList(attr.mWinLevel, GameWinLevel.CREATOR);
            return attr;
        }

        @Override
        public GameWinBulletin[] newArray(int size) {
            return new GameWinBulletin[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int flags) {
        parcel.writeInt(mGameID);
        parcel.writeLong(mGameIssue);
        parcel.writeString(mGameName);
        parcel.writeDouble(mAllSales);
        parcel.writeIntArray(mWinNumber);
        parcel.writeTypedList(mWinPool);
        parcel.writeTypedList(mWinLevel);
    }
}
