import { Action } from "../Engine/CatanEngine/CSharp/System/Action";
import MainControlData from "./DataReceived/MainControlData";

export class MainControl {
	// =======================================================================================
	/** MainControl實例 */
	private static _instance: MainControl = null;
	public static get Instance(): MainControl { return this._instance; }
	public static readonly DataReceivedEvent: Action<any[]> = new Action<any[]>();
	/** false被動斷線true主動斷線 */
	public IsLogout: boolean = false;

	public onLoad(): void {
		MainControl._instance = this;
		this._initialEngine();
	}

	private _initialEngine(): void {
		new MainControlData();
	}
}
export module MainControl {
	export enum DataType {
		ServerData,
		ChangeDire,
		NetDisconnected,
	}
}