mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 14:53:21 +08:00
Expose Mods in DrawableRuleset to avoid using external DI
This commit is contained in:
parent
aaa0362b12
commit
f84ea30637
@ -62,8 +62,7 @@ namespace osu.Game.Rulesets.Osu.Mods
|
||||
inputManager.AllowUserCursorMovement = false;
|
||||
|
||||
// Generate the replay frames the cursor should follow
|
||||
var mods = (IReadOnlyList<Mod>)drawableRuleset.Dependencies.Get(typeof(IReadOnlyList<Mod>));
|
||||
replayFrames = new OsuAutoGenerator(drawableRuleset.Beatmap, mods).Generate().Frames.Cast<OsuReplayFrame>().ToList();
|
||||
replayFrames = new OsuAutoGenerator(drawableRuleset.Beatmap, drawableRuleset.Mods).Generate().Frames.Cast<OsuReplayFrame>().ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,8 +18,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
public virtual void ApplyToDrawableRuleset(DrawableRuleset<T> drawableRuleset)
|
||||
{
|
||||
var mods = (IReadOnlyList<Mod>)drawableRuleset.Dependencies.Get(typeof(IReadOnlyList<Mod>));
|
||||
drawableRuleset.SetReplayScore(CreateReplayScore(drawableRuleset.Beatmap, mods));
|
||||
drawableRuleset.SetReplayScore(CreateReplayScore(drawableRuleset.Beatmap, drawableRuleset.Mods));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
// 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.Collections.Generic;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
@ -15,8 +14,7 @@ namespace osu.Game.Rulesets.Mods
|
||||
{
|
||||
public virtual void ApplyToDrawableRuleset(DrawableRuleset<T> drawableRuleset)
|
||||
{
|
||||
var mods = (IReadOnlyList<Mod>)drawableRuleset.Dependencies.Get(typeof(IReadOnlyList<Mod>));
|
||||
drawableRuleset.SetReplayScore(CreateReplayScore(drawableRuleset.Beatmap, mods));
|
||||
drawableRuleset.SetReplayScore(CreateReplayScore(drawableRuleset.Beatmap, drawableRuleset.Mods));
|
||||
|
||||
// AlwaysPresent required for hitsounds
|
||||
drawableRuleset.Playfield.AlwaysPresent = true;
|
||||
|
@ -92,7 +92,7 @@ namespace osu.Game.Rulesets.UI
|
||||
protected IRulesetConfigManager Config { get; private set; }
|
||||
|
||||
[Cached(typeof(IReadOnlyList<Mod>))]
|
||||
protected override IReadOnlyList<Mod> Mods { get; }
|
||||
public sealed override IReadOnlyList<Mod> Mods { get; }
|
||||
|
||||
private FrameStabilityContainer frameStabilityContainer;
|
||||
|
||||
@ -434,7 +434,7 @@ namespace osu.Game.Rulesets.UI
|
||||
/// <summary>
|
||||
/// The mods which are to be applied.
|
||||
/// </summary>
|
||||
protected abstract IReadOnlyList<Mod> Mods { get; }
|
||||
public abstract IReadOnlyList<Mod> Mods { get; }
|
||||
|
||||
/// <summary>~
|
||||
/// The associated ruleset.
|
||||
|
Loading…
Reference in New Issue
Block a user