import { AdData } from "./AdData";
import { AppData } from "./AppData";
import { GameData } from "./GameData";
import { HttpData } from "./HttpData";
import { LoginData } from "./LoginData";
import { StorageData } from "./StorageData";
import { WechatData } from "./WechatData";

/**
 * 数据集合全局类
 * @description 所有数据都通过这个类创建，修改，删除
 * @author 邹勇
 */
class g {
    constructor() {
        this.init();
    }

    public loginData:LoginData;
    public appData:AppData;
    public gameData:GameData;
    public wechatData:WechatData;
    public httpData:HttpData;
    public adData:AdData;
    public storageData:StorageData;

    init() {
        this.appData = new AppData();
        this.loginData = new LoginData();
        this.gameData = new GameData();
        this.wechatData = new WechatData();
        this.httpData = new HttpData();
        this.adData = new AdData();
        this.storageData = new StorageData();
    }      
}

declare global {
    const g: g;
}
window['g'] = new g();

