/**
 *Created by cuiliqiang on 2018/3/1
 * 开始游戏
 */
import { Data } from "../../Data";
import { IExtraData } from "./ExtraData";

export class DoStartData extends Data {
    /**
     * 附加数据
     */
    public extra: IExtraData;

    /**
     * 订单ID
     */
    public ticketId: number;

    /**
     * 提交游戏数据token
     */
    public submitToken: string;

    /**
     * 
     */
    public token: string;

    /**
     * 剩余积分
     */
    public credits: number;

    constructor() {
        super();
    }

    public update(data: any): void {
        if (!data) {
            return;
        }
        super.update(data);
        this.extra = data.extra;
        this.ticketId = data.ticketId;
        this.credits = data.credits;
        this.submitToken = window['resolve'](data.submitToken);
        this.token = window['resolve'](data.token);
    }
}