Ensure `ScoreProcessor` is still hooked up in special case

This commit is contained in:
Dean Herbert 2021-06-01 16:24:38 +09:00
parent 3ba0d29108
commit 790f1dacc9
1 changed files with 8 additions and 4 deletions

View File

@ -51,12 +51,16 @@ public TestPlayer(bool allowPause = true, bool showResults = true, bool pauseOnF
protected override void PrepareReplay()
{
var replayGeneratingMod = Mods.Value.OfType<ICreateReplay>().FirstOrDefault();
var autoplayMod = Mods.Value.OfType<ModAutoplay>().FirstOrDefault();
if (replayGeneratingMod != null)
// This logic should really not exist (and tests should be instantiating a ReplayPlayer), but a lot of base work is required to make that happen.
if (autoplayMod != null)
{
// This logic should really not exist (and tests should be instantiating a ReplayPlayer), but a lot of base work is required to make that happen.
DrawableRuleset?.SetReplayScore(replayGeneratingMod.CreateReplayScore(GameplayBeatmap.PlayableBeatmap, Mods.Value));
var replayScore = autoplayMod.CreateReplayScore(GameplayBeatmap.PlayableBeatmap, Mods.Value);
DrawableRuleset?.SetReplayScore(replayScore);
ScoreProcessor.NewJudgement += result => ScoreProcessor.PopulateScore(replayScore.ScoreInfo);
return;
}