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

//=======================================================================================
interface ChoiceRequest {
}

/**五龍選擇協定 */
export class Slot_ChoiceRequest extends NetRequestSD<ChoiceRequest, number> {
	get Method(): string {
		return "slot.req";
	}

	constructor(id: number) {
		super();
		this.Data = id;
	}
}
//=======================================================================================
interface GmRequest {
	pay: number;
	slot: string;
	type: number;
}

export class Slot_GMRequest extends NetRequestSD<GmRequest, JSON> {
	get Method(): string {
		return "slot.gm";
	}

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

	private _id: number = 1;

	constructor(id: number, totalBet: number, symbols: string, type: number) {
		super();
		this._id = id;
		this.Data = {
			pay: totalBet,
			slot: symbols,
			type: type,
		};
	}
}
//=======================================================================================
export class Bingo_GMRequest extends NetRequestSD<GmRequest, JSON> {
	get Method(): string {
		return "bingo.gm";
	}

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

	private _id: number = 0;

	constructor(id: number, totalBet: number, bingos: string, type: number) {
		super();
		this._id = id;
		this.Data = {
			pay: totalBet,
			slot: bingos,
			type: type,
		};
	}
}
//=======================================================================================
/**前後端金額對不上協定 */
export class Slot_ErrorRequest extends NetRequestSD<any, JSON> {
	get Method(): string {
		return "slot.error";
	}
	constructor() {
		super();
	}
}
//=======================================================================================
