Pass a score to the replay recorder to allow reading more general scoring data

This commit is contained in:
Dean Herbert
2020-12-14 16:52:14 +09:00
parent 51e8a05f18
commit 1793385e96
14 changed files with 41 additions and 34 deletions

View File

@ -10,8 +10,8 @@ using osu.Framework.Input;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Game.Online.Spectator;
using osu.Game.Replays;
using osu.Game.Rulesets.Replays;
using osu.Game.Scoring;
using osu.Game.Screens.Play;
using osuTK;
@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.UI
public abstract class ReplayRecorder<T> : ReplayRecorder, IKeyBindingHandler<T>
where T : struct
{
private readonly Replay target;
private readonly Score target;
private readonly List<T> pressedActions = new List<T>();
@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.UI
[Resolved]
private GameplayBeatmap gameplayBeatmap { get; set; }
protected ReplayRecorder(Replay target)
protected ReplayRecorder(Score target)
{
this.target = target;
@ -79,7 +79,7 @@ namespace osu.Game.Rulesets.UI
private void recordFrame(bool important)
{
var last = target.Frames.LastOrDefault();
var last = target.Replay.Frames.LastOrDefault();
if (!important && last != null && Time.Current - last.Time < (1000d / RecordFrameRate))
return;
@ -90,7 +90,7 @@ namespace osu.Game.Rulesets.UI
if (frame != null)
{
target.Frames.Add(frame);
target.Replay.Frames.Add(frame);
spectatorStreaming?.HandleFrame(frame);
}