mirror of
https://github.com/ppy/osu.git
synced 2025-01-06 07:42:55 +08:00
Add assertion and comment about lease logic
This commit is contained in:
parent
d489a77fe1
commit
54f5e6aedf
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
|
|
||||||
@ -13,6 +14,9 @@ namespace osu.Game.Screens.Play
|
|||||||
public ReplayPlayerLoader(Score score)
|
public ReplayPlayerLoader(Score score)
|
||||||
: base(() => new ReplayPlayer(score))
|
: base(() => new ReplayPlayer(score))
|
||||||
{
|
{
|
||||||
|
if (score.Replay == null)
|
||||||
|
throw new ArgumentNullException(nameof(score.Replay), $"{nameof(score)} must have a non-null {nameof(score.Replay)}.");
|
||||||
|
|
||||||
scoreInfo = score.ScoreInfo;
|
scoreInfo = score.ScoreInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -20,6 +24,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
var dependencies = base.CreateChildDependencies(parent);
|
var dependencies = base.CreateChildDependencies(parent);
|
||||||
|
|
||||||
|
// these will be reverted thanks to PlayerLoader's lease.
|
||||||
Mods.Value = scoreInfo.Mods;
|
Mods.Value = scoreInfo.Mods;
|
||||||
Ruleset.Value = scoreInfo.Ruleset;
|
Ruleset.Value = scoreInfo.Ruleset;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user