1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-17 19:02:56 +08:00
osu-lazer/osu.Game/Screens/Play/ReplayPlayerLoader.cs

33 lines
957 B
C#
Raw Normal View History

2023-06-23 00:37:25 +08:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Screens;
using osu.Game.Scoring;
namespace osu.Game.Screens.Play
{
2022-11-24 13:32:20 +08:00
public partial class ReplayPlayerLoader : PlayerLoader
{
2020-06-15 19:32:27 +08:00
public readonly ScoreInfo Score;
2019-07-08 15:13:03 +08:00
public ReplayPlayerLoader(Score score)
: base(() => new ReplayPlayer(score))
{
if (score.Replay == null)
2019-11-28 22:21:21 +08:00
throw new ArgumentException($"{nameof(score)} must have a non-null {nameof(score.Replay)}.", nameof(score));
2020-06-15 19:32:27 +08:00
Score = score.ScoreInfo;
}
public override void OnEntering(ScreenTransitionEvent e)
{
// these will be reverted thanks to PlayerLoader's lease.
2020-06-15 19:32:27 +08:00
Mods.Value = Score.Mods;
Ruleset.Value = Score.Ruleset;
base.OnEntering(e);
}
}
}