1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 08:27:49 +08:00

Pass ScoreProcessorStatistics to FrameHeader, rather than the full processor

This commit is contained in:
Dean Herbert 2023-05-29 20:00:42 +09:00
parent 1a6d9e9ff0
commit df662afbd5
2 changed files with 4 additions and 5 deletions

View File

@ -24,7 +24,7 @@ namespace osu.Game.Online.Spectator
public FrameDataBundle(ScoreInfo score, ScoreProcessor scoreProcessor, IList<LegacyReplayFrame> frames) public FrameDataBundle(ScoreInfo score, ScoreProcessor scoreProcessor, IList<LegacyReplayFrame> frames)
{ {
Frames = frames; Frames = frames;
Header = new FrameHeader(score, scoreProcessor); Header = new FrameHeader(score, scoreProcessor.GetScoreProcessorStatistics());
} }
[JsonConstructor] [JsonConstructor]

View File

@ -60,18 +60,17 @@ namespace osu.Game.Online.Spectator
/// Construct header summary information from a point-in-time reference to a score which is actively being played. /// Construct header summary information from a point-in-time reference to a score which is actively being played.
/// </summary> /// </summary>
/// <param name="score">The score for reference.</param> /// <param name="score">The score for reference.</param>
/// <param name="scoreProcessor">The score processor for reference.</param> /// <param name="statistics">The score processor statistics for the current point in time.</param>
public FrameHeader(ScoreInfo score, ScoreProcessor scoreProcessor) public FrameHeader(ScoreInfo score, ScoreProcessorStatistics statistics)
{ {
TotalScore = score.TotalScore; TotalScore = score.TotalScore;
Accuracy = score.Accuracy; Accuracy = score.Accuracy;
Combo = score.Combo; Combo = score.Combo;
MaxCombo = score.MaxCombo; MaxCombo = score.MaxCombo;
// copy for safety // copy for safety
Statistics = new Dictionary<HitResult, int>(score.Statistics); Statistics = new Dictionary<HitResult, int>(score.Statistics);
ScoreProcessorStatistics = scoreProcessor.GetScoreProcessorStatistics(); ScoreProcessorStatistics = statistics;
} }
[JsonConstructor] [JsonConstructor]