class GlobalGameSettings
{
    constructor()
    {
        this.app = null;
        
        this.userID = -1;
        this.hash = "";
        this._instanceID = 0;
        this.languageID = 1;
		
		this.debugMode = true;

        //Version Information
        this.uiScale = 1;
        this._targetFramerate = 60;


        //this should be called again after engine settings updated.
        this.init();
    }

    init()
    {
        if (this.ADMIN)
        {
            this._mobileClientVersion = 999999;
        } 
        else 
        {
            this._mobileClientVersion = 237;
        }

        EngineSettings.JSONDefaults["network_id"] = "" + this.platform;
        EngineSettings.JSONDefaults["mobile_client_version"] = "" + this._mobileClientVersion;
    }

    set mobileClientVersion(value) { this.mobileClientVersion = value; EngineSettings.JSONDefaults["mobile_client_version"] = "" + this.mobileClientVersion; }
    get mobileClientVersion() { return this._mobileClientVersion; }

    get screenWidth() { return EngineSettings.Pixi.screen.width; }
    get screenHeight() { return EngineSettings.Pixi.screen.height; }

    get ADMIN() { return true; /*EngineSettings.WebRoot.indexOf("dev3") != -1;*/ }

    get instanceID() { return this._instanceID; }
    set instanceID(value)
    {
        this._instanceID = value;
        EngineSettings.JSONDefaults["instance_id"] = "" + value;
    }

    get targetFramerate() { return this._targetFramerate; }
    set targetFramerate(value) 
    {
        this._targetFramerate = value;
        EngineSettings.Pixi.ticker.maxFPS = this.targetFramerate;
    }

    saveLocalSettings()
    {
        //TODO webgl:... decide where what was previously saved locally should be stored...
        //Game.UserDataInstance.forceSave();
    }
}

var GameSettings = new GlobalGameSettings();