private async void LoadState() { var reader = new BeatmapReader(); var source = await Windows.Storage.FileIO.ReadTextAsync(await StorageFile.GetFileFromApplicationUriAsync(filePath)); var map = reader.Read(source); map.ToString(); }
public void read(string beatmap_name) { string path = beatmap_path + beatmap_name; StreamReader reader = new StreamReader(path); BeatmapReader map = JsonUtility.FromJson <BeatmapReader>(reader.ReadToEnd()); this.notes = map.notes; Debug.Log(map.notes.Count); Debug.Log(map.radius); Debug.Log("c time: " + map.notes[0].time); this.sliders = map.sliders; this.approach = map.approach; this.drain = map.drain; this.radius = map.radius; }
public object GetFcpp(double acc) { PerformanceCalculatorBase cal = GetCalculator(); if (cal is null) { return(new ActionResult(null, 500, "The server could not get pp calculator.")); } if (_beatmap is null) { return(new ActionResult(null, 500, "The server could not get beatmap.")); } if (_reader is null || _reader.OrtdpBeatmap.BeatmapID != _beatmap.BeatmapID) { cal.ClearCache(); _reader = new BeatmapReader(_beatmap, (int)_mode); } if (_reader is null) { return(new ActionResult(null, 500, "The server could not create BeatmapReader.")); } cal.AccuracyRound(acc, _reader.ObjectsCount, 0, out int n300, out int n100, out int n50); cal.Mods = _mods; cal.Beatmap = _reader; cal.Count50 = n50; cal.Count100 = n100; cal.Count300 = n300; cal.CountMiss = 0; var pptuple = cal.GetPerformance(); return(new ActionResult(new { pp = pptuple.FullComboPP, aim_pp = pptuple.FullComboAimPP, speed_pp = pptuple.FullComboSpeedPP, acc_pp = pptuple.FullComboAccuracyPP, })); }
private void RtppOnBeatmapChanged(OsuRTDataProvider.BeatmapInfo.Beatmap beatmap) { string file = beatmap.FilenameFull; if (string.IsNullOrWhiteSpace(file)) { CurrentIO.WriteColor($"[RealTimePPDisplayer]No found .osu file(Set:{beatmap.BeatmapSetID} Beatmap:{beatmap.BeatmapID}])", ConsoleColor.Yellow); _beatmapReader = null; return; } if (Setting.DebugMode) { CurrentIO.WriteColor($"[RealTimePPDisplayer]File:{file}", ConsoleColor.Blue); } _beatmapReader = new BeatmapReader(beatmap, _mode); _ppCalculator.ClearCache(); }
private void RTPPOnBeatmapChanged(OsuRTDataProvider.BeatmapInfo.Beatmap beatmap) { if (string.IsNullOrWhiteSpace(beatmap.Difficulty)) { m_beatmap_reader = null; return; } string file = beatmap.FilenameFull; if (string.IsNullOrWhiteSpace(file)) { Sync.Tools.IO.CurrentIO.WriteColor($"[RealTimePPDisplayer]No found .osu file(Set:{beatmap.BeatmapSetID} Beatmap:{beatmap.BeatmapID}])", ConsoleColor.Yellow); m_beatmap_reader = null; return; } if (Setting.DebugMode) { Sync.Tools.IO.CurrentIO.WriteColor($"[RealTimePPDisplayer]File:{file}", ConsoleColor.Blue); } m_beatmap_reader = new BeatmapReader(file); }