Exemplo n.º 1
0
        public void EmitStatusUpdate(ChangedProperties changedProps, string cause)
        {
            gameStatus.updateCause = cause;

            if (changedProps.game)
            {
                UpdateGameJSON();
            }
            if (changedProps.beatmap)
            {
                UpdateBeatmapJSON();
            }
            if (changedProps.performance)
            {
                UpdatePerformanceJSON();
            }
            if (changedProps.noteCut)
            {
                UpdateNoteCutJSON();
            }
            if (changedProps.mod)
            {
                UpdateModJSON();
                UpdatePlayerSettingsJSON();
            }
            if (changedProps.beatmapEvent)
            {
                UpdateBeatmapEventJSON();
            }

            statusChange?.Invoke(this, changedProps, cause);
        }
Exemplo n.º 2
0
        public void EmitStatusUpdate(ChangedProperties changedProps, string cause)
        {
            gameStatus.updateCause = cause;

            if (changedProps.game)
            {
                UpdateGameJSON();
            }
            if (changedProps.beatmap)
            {
                UpdateBeatmapJSON();
            }
            if (changedProps.performance)
            {
                UpdatePerformanceJSON();
            }
            if (changedProps.noteCut)
            {
                UpdateNoteCutJSON();
            }
            if (changedProps.mod)
            {
                UpdateModJSON();
            }

            if (statusChange != null)
            {
                statusChange(this, changedProps, cause);
            }
        }
Exemplo n.º 3
0
        public void OnStatusChange(StatusManager statusManager, ChangedProperties changedProps, string cause)
        {
            JSONObject eventJSON = new JSONObject();

            eventJSON["event"] = cause;
            eventJSON["time"]  = new JSONNumber(Plugin.GetCurrentTime());

            if (changedProps.game && changedProps.beatmap && changedProps.performance && changedProps.mod)
            {
                eventJSON["status"] = statusManager.statusJSON;
            }
            else
            {
                JSONObject status = new JSONObject();
                eventJSON["status"] = status;

                if (changedProps.game)
                {
                    status["game"] = statusManager.statusJSON["game"];
                }
                if (changedProps.beatmap)
                {
                    status["beatmap"] = statusManager.statusJSON["beatmap"];
                }
                if (changedProps.performance)
                {
                    status["performance"] = statusManager.statusJSON["performance"];
                }
                if (changedProps.mod)
                {
                    status["mod"]            = statusManager.statusJSON["mod"];
                    status["playerSettings"] = statusManager.statusJSON["playerSettings"];
                }
            }

            if (changedProps.noteCut)
            {
                eventJSON["noteCut"] = statusManager.noteCutJSON;
            }

            if (changedProps.beatmapEvent)
            {
                eventJSON["beatmapEvent"] = statusManager.beatmapEventJSON;
            }

            Send(eventJSON.ToString());
        }