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); }
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); } }
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()); }