private void RefreshBeatmap() { typeof(WorkingBeatmap) .GetField("beatmapLoadTask", BindingFlags.Instance | BindingFlags.NonPublic) .SetValue(PpBeatmap, null); CurrentPlayingBeatmap = PpBeatmap.GetPlayableBeatmap(Ruleset.RulesetInfo, Score.Mods); typeof(PerformanceCalculator) .GetField("Beatmap", BindingFlags.Instance | BindingFlags.NonPublic) .SetValue(LazerCalculator, CurrentPlayingBeatmap); var nextAttributes = Ruleset.CreateDifficultyCalculator(PpBeatmap).Calculate(Score.Mods); typeof(PerformanceCalculator) .GetField("Attributes", BindingFlags.Instance | BindingFlags.NonPublic) .SetValue(LazerCalculator, nextAttributes); RefreshMaxCombo(CurrentPlayingBeatmap); LazerCalculator.GetType() .GetField("countHitCircles", BindingFlags.Instance | BindingFlags.NonPublic) .SetValue(LazerCalculator, Max300); LazerCalculator.GetType() .GetField("beatmapMaxCombo", BindingFlags.Instance | BindingFlags.NonPublic) .SetValue(LazerCalculator, MaxCombo); typeof(PerformanceCalculator).GetMethod("ApplyMods", BindingFlags.Instance | BindingFlags.NonPublic) .Invoke(LazerCalculator, new[] { Score.Mods }); }
public void Refresh() { var pp = LazerCalculator.Calculate(); if (Performance != pp) { PerformanceChanged?.Invoke(pp); this.Performance = pp; } }