1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 16:32:54 +08:00

Remove unnecessary ApplyBeatmap call

This commit is contained in:
Dan Balasescu 2022-06-02 14:47:04 +09:00
parent 793dfe2bc8
commit 6fb1fe06a0

View File

@ -10,12 +10,8 @@ using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Beatmaps.Timing;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring;
@ -109,10 +105,7 @@ namespace osu.Game.Online.Spectator
spectatorState = userState;
scoreInfo = new ScoreInfo { Ruleset = rulesetInfo };
scoreProcessor = ruleset.CreateScoreProcessor();
// Mods are required for score multiplier.
scoreProcessor.Mods.Value = userState.Mods.Select(m => m.ToMod(ruleset)).ToArray();
scoreProcessor.ApplyBeatmap(new DummyBeatmap());
}
private void onNewFrames(int incomingUserId, FrameDataBundle bundle)
@ -165,23 +158,6 @@ namespace osu.Game.Online.Spectator
spectatorClient.OnNewFrames -= onNewFrames;
}
private class DummyBeatmap : IBeatmap
{
public BeatmapInfo BeatmapInfo { get; set; } = new BeatmapInfo();
public BeatmapMetadata Metadata { get; } = new BeatmapMetadata();
public BeatmapDifficulty Difficulty { get; set; } = new BeatmapDifficulty();
public ControlPointInfo ControlPointInfo { get; set; } = new ControlPointInfo();
public List<BreakPeriod> Breaks { get; } = new List<BreakPeriod>();
public double TotalBreakTime => 0;
public IReadOnlyList<HitObject> HitObjects => Array.Empty<HitObject>();
public IEnumerable<BeatmapStatistic> GetStatistics() => Array.Empty<BeatmapStatistic>();
public double GetMostCommonBeatLength() => 0;
public IBeatmap Clone() => throw new NotImplementedException();
}
private class TimedFrame : IComparable<TimedFrame>
{
public readonly double Time;