1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 15:27:24 +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)
{
Frames = frames;
Header = new FrameHeader(score, scoreProcessor);
Header = new FrameHeader(score, scoreProcessor.GetScoreProcessorStatistics());
}
[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.
/// </summary>
/// <param name="score">The score for reference.</param>
/// <param name="scoreProcessor">The score processor for reference.</param>
public FrameHeader(ScoreInfo score, ScoreProcessor scoreProcessor)
/// <param name="statistics">The score processor statistics for the current point in time.</param>
public FrameHeader(ScoreInfo score, ScoreProcessorStatistics statistics)
{
TotalScore = score.TotalScore;
Accuracy = score.Accuracy;
Combo = score.Combo;
MaxCombo = score.MaxCombo;
// copy for safety
Statistics = new Dictionary<HitResult, int>(score.Statistics);
ScoreProcessorStatistics = scoreProcessor.GetScoreProcessorStatistics();
ScoreProcessorStatistics = statistics;
}
[JsonConstructor]