
//=======================================================================================

import { NetRequestSD } from "../../../Engine/CatanEngine/NetManagerV2/NetRequestSD";

/**共用MAIN SPIN協定 */
export interface SpinRequest {
	pay: number;
	/** Cluster系列機台必帶(0=一般Spin) */
	mode?: number;
}

export class CommonSlotSpinRequest extends NetRequestSD<SpinRequest, JSON> {
	private _id: number = 0;

	get Method(): string {
		return "slot" + this._id + ".spin";
	}

	constructor(slotId: number, totalBet: number, mode: number = null) {
		super();
		this._id = slotId;
		this.Data = {
			pay: totalBet,
		};
		if (mode !== null && mode !== undefined) {
			this.Data.mode = mode;
		}
	}
}
//=======================================================================================
export class CommonSlotFgSpinRequest extends NetRequestSD<any, JSON> {
	private _id: number = 0;

	get Method(): string {
		return "slot" + this._id + ".fgspin";
	}

	constructor(slotId: number) {
		super();
		this._id = slotId;
	}
}
//=======================================================================================
export class CommonSlotCollectUnlockRequest extends NetRequestSD<any, JSON> {
	private _id: number = 0;
	get Method(): string {
		return "collect" + this._id + ".unlock";
	}

	constructor(slotId: number, grid: number) {
		super();
		this._id = slotId;
		this.Data = {
			Grid: grid,
		};
	}
}
//=======================================================================================
export class CommonSlotCollectSpinRequest extends NetRequestSD<any, JSON> {
	private _id: number = 0;
	get Method(): string {
		return "collect" + this._id + ".spin";
	}

	constructor(slotId: number) {
		super();
		this._id = slotId;
	}
}
//=======================================================================================
/**賓果 ChangeSet協定 */
export class CommonBingoChangeSet extends NetRequestSD<any, JSON> {
	private _id: number = 0;
	get Method(): string {
		return "slot" + this._id + ".chset";
	}
	constructor(slotId: number) {
		super();
		this._id = slotId;
	}
}
//=======================================================================================
/** 動畫結束通知 */
export class CommonSlotAERequest extends NetRequestSD<null, null> {
	get Method(): string {
		return "slot.ae";
	}
	constructor() {
		super();
	}
}
//=======================================================================================