/**
 * 本機系統記錄(切換帳號也不可刪除EX記錄音效開關)
 */
export default class LocalStorageData {
	private static _instance: LocalStorageData = null;
	public static get Instance(): LocalStorageData {
		return LocalStorageData._instance;
	}

	constructor() {
		LocalStorageData._instance = this;
	}

	// =======================================================================================
	//
	public get CompileVersion(): string { return cc.sys.localStorage.getItem("CompileVersion"); }
	public set CompileVersion(value: string) { cc.sys.localStorage.setItem("CompileVersion", value.toString()); }
	//
	public get RemoteVerList(): string { return cc.sys.localStorage.getItem("RemoteVerList"); }
	public set RemoteVerList(value: string) { cc.sys.localStorage.setItem("RemoteVerList", value); }
	//
	public get LocalVerList(): string { return cc.sys.localStorage.getItem("LocalVerList"); }
	public set LocalVerList(value: string) { cc.sys.localStorage.setItem("LocalVerList", value); }
	//
	public get ComboDeviceID(): string { return cc.sys.localStorage.getItem("ComboDeviceID") || ""; }
	public set ComboDeviceID(value: string) { cc.sys.localStorage.setItem("ComboDeviceID", value); }
	//
	public get BundleUrl(): string { return cc.sys.localStorage.getItem("BundleUrl"); }
	public set BundleUrl(value: string) { cc.sys.localStorage.setItem("BundleUrl", value); }
	//
	public get Language(): string { return cc.sys.localStorage.getItem("language"); }
	public set Language(value: string) { cc.sys.localStorage.setItem("language", value); }
	//
	public get MusicType(): string { return cc.sys.localStorage.getItem("MusicType"); }
	public set MusicType(value: string) { cc.sys.localStorage.setItem("MusicType", value); }
	//
	public get SoundType(): string { return cc.sys.localStorage.getItem("SoundType"); }
	public set SoundType(value: string) { cc.sys.localStorage.setItem("SoundType", value); }
	//
	public get LvUpNotifyType(): boolean { return JSON.parse(cc.sys.localStorage.getItem("LvUpNotifyType")); }
	public set LvUpNotifyType(value: boolean) { cc.sys.localStorage.setItem("LvUpNotifyType", JSON.stringify(value)); }
	//
	public get WinNotifyType(): boolean { return JSON.parse(cc.sys.localStorage.getItem("WinNotifyType")); }
	public set WinNotifyType(value: boolean) { cc.sys.localStorage.setItem("WinNotifyType", JSON.stringify(value)); }
	//
	public get DownloadList_Preview(): string { return cc.sys.localStorage.getItem("DownloadList_Preview"); }
	public set DownloadList_Preview(value: string) { cc.sys.localStorage.setItem("DownloadList_Preview", value); }
	//
	public get AutoLogin(): number { return Number.parseInt(cc.sys.localStorage.getItem("AutoLogin")); }
	public set AutoLogin(value: number) { cc.sys.localStorage.setItem("AutoLogin", value); }
	//
	public get GameInfoData(): string[] { return JSON.parse(cc.sys.localStorage.getItem("GameInfoData")); }
	public set GameInfoData(value: string[]) { cc.sys.localStorage.setItem("GameInfoData", JSON.stringify(value)); }
	//
	public get LoginDays(): string[] { return JSON.parse(cc.sys.localStorage.getItem("LoginDays")); }
	public set LoginDays(value: string[]) { cc.sys.localStorage.setItem("LoginDays", JSON.stringify(value)); }
}