import { NetRequest } from "../../Engine/CatanEngine/NetManagerV2/NetRequest";
import { Role } from "./ChatRequest";

export namespace ProfileRequest {
	// =======================================================================================
	export type InfoRequest = number;
	export interface InfoResponse {
		aId: number
		name: string
		msg: string
		money: number
		lp: number
		vip: number
		phone: string
		avatar: 0 | 1
	}
	export enum InfoError {
		NoPlayer = 11,
	}
	/** 個人資訊 */
	export class Info extends NetRequest<InfoRequest, InfoResponse> {
		get Method(): string {
			return "profile.info";
		}
		constructor(aid: number) {
			super();
			this.Data = aid;
		}
	}
	// =======================================================================================
	/**修改暱稱 */
	export class ChangeName extends NetRequest<string, null> {
		get Method(): string {
			return "profile.name";
		}
		constructor(name: string) {
			super();
			this.Data = name;
		}
	}
	// =======================================================================================
	/**修改自介 */
	export class ChangeMsg extends NetRequest<string, null> {
		get Method(): string {
			return "profile.msg";
		}
		constructor(message: string) {
			super();
			this.Data = message;
		}
	}
	// =======================================================================================
	export enum MInfoType {
		/** 聊天 */
		Chat = 1
	}
	export interface MInfoResponse {
		aID: MInfoData
	}
	export type MInfoData = [role: Role, name: string, avatar: 0 | 1, vip: number]
	/**多人資訊 */
	export class MInfo extends NetRequest<any, MInfoResponse> {
		get Method(): string {
			return "profile.m_info";
		}
		constructor(MInfoType: number, aIDs: number[]) {
			super();
			this.Data = [MInfoType, aIDs];
		}
	}
	// =======================================================================================
}