Rename RulesetContainer to DrawableRuleset

This commit is contained in:
Dean Herbert
2019-03-19 23:44:15 +09:00
parent 68f28326a2
commit baea7230bc
40 changed files with 175 additions and 175 deletions

View File

@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Catch.Tests
typeof(DrawableBananaShower), typeof(DrawableBananaShower),
typeof(CatchRuleset), typeof(CatchRuleset),
typeof(CatchRulesetContainer), typeof(DrawableCatchRuleset),
}; };
public TestCaseBananaShower() public TestCaseBananaShower()

View File

@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Catch
{ {
public class CatchRuleset : Ruleset public class CatchRuleset : Ruleset
{ {
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap) => new CatchRulesetContainer(this, beatmap); public override DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap) => new DrawableCatchRuleset(this, beatmap);
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new CatchBeatmapConverter(beatmap); public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new CatchBeatmapConverter(beatmap);
public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => new CatchBeatmapProcessor(beatmap); public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => new CatchBeatmapProcessor(beatmap);

View File

@ -21,10 +21,10 @@ namespace osu.Game.Rulesets.Catch.Mods
private CatchPlayfield playfield; private CatchPlayfield playfield;
public override void ApplyToRulesetContainer(RulesetContainer<CatchHitObject> rulesetContainer) public override void ApplyToDrawableRuleset(DrawableRuleset<CatchHitObject> rrawableRuleset)
{ {
playfield = (CatchPlayfield)rulesetContainer.Playfield; playfield = (CatchPlayfield)rrawableRuleset.Playfield;
base.ApplyToRulesetContainer(rulesetContainer); base.ApplyToDrawableRuleset(rrawableRuleset);
} }
private class CatchFlashlight : Flashlight private class CatchFlashlight : Flashlight

View File

@ -13,8 +13,8 @@ namespace osu.Game.Rulesets.Catch.Scoring
{ {
public class CatchScoreProcessor : ScoreProcessor<CatchHitObject> public class CatchScoreProcessor : ScoreProcessor<CatchHitObject>
{ {
public CatchScoreProcessor(RulesetContainer<CatchHitObject> rulesetContainer) public CatchScoreProcessor(DrawableRuleset<CatchHitObject> rrawableRuleset)
: base(rulesetContainer) : base(rrawableRuleset)
{ {
} }

View File

@ -17,13 +17,13 @@ using osu.Game.Rulesets.UI.Scrolling;
namespace osu.Game.Rulesets.Catch.UI namespace osu.Game.Rulesets.Catch.UI
{ {
public class CatchRulesetContainer : ScrollingRulesetContainer<CatchPlayfield, CatchHitObject> public class DrawableCatchRuleset : DrawableScrollingRuleset<CatchPlayfield, CatchHitObject>
{ {
protected override ScrollVisualisationMethod VisualisationMethod => ScrollVisualisationMethod.Constant; protected override ScrollVisualisationMethod VisualisationMethod => ScrollVisualisationMethod.Constant;
protected override bool UserScrollSpeedAdjustment => false; protected override bool UserScrollSpeedAdjustment => false;
public CatchRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap) public DrawableCatchRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
: base(ruleset, beatmap) : base(ruleset, beatmap)
{ {
Direction.Value = ScrollingDirection.Down; Direction.Value = ScrollingDirection.Down;

View File

@ -10,11 +10,11 @@ using osu.Game.Rulesets.UI.Scrolling;
namespace osu.Game.Rulesets.Mania.Edit namespace osu.Game.Rulesets.Mania.Edit
{ {
public class ManiaEditRulesetContainer : ManiaRulesetContainer public class DrawableManiaEditRuleset : DrawableManiaRuleset
{ {
public new IScrollingInfo ScrollingInfo => base.ScrollingInfo; public new IScrollingInfo ScrollingInfo => base.ScrollingInfo;
public ManiaEditRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap) public DrawableManiaEditRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
: base(ruleset, beatmap) : base(ruleset, beatmap)
{ {
} }

View File

@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Mania.Edit
[Cached(Type = typeof(IManiaHitObjectComposer))] [Cached(Type = typeof(IManiaHitObjectComposer))]
public class ManiaHitObjectComposer : HitObjectComposer<ManiaHitObject>, IManiaHitObjectComposer public class ManiaHitObjectComposer : HitObjectComposer<ManiaHitObject>, IManiaHitObjectComposer
{ {
protected new ManiaEditRulesetContainer RulesetContainer { get; private set; } protected new DrawableManiaEditRuleset DrawableRuleset { get; private set; }
public ManiaHitObjectComposer(Ruleset ruleset) public ManiaHitObjectComposer(Ruleset ruleset)
: base(ruleset) : base(ruleset)
@ -32,23 +32,23 @@ namespace osu.Game.Rulesets.Mania.Edit
/// </summary> /// </summary>
/// <param name="screenSpacePosition">The screen-space position.</param> /// <param name="screenSpacePosition">The screen-space position.</param>
/// <returns>The column which intersects with <paramref name="screenSpacePosition"/>.</returns> /// <returns>The column which intersects with <paramref name="screenSpacePosition"/>.</returns>
public Column ColumnAt(Vector2 screenSpacePosition) => RulesetContainer.GetColumnByPosition(screenSpacePosition); public Column ColumnAt(Vector2 screenSpacePosition) => DrawableRuleset.GetColumnByPosition(screenSpacePosition);
private DependencyContainer dependencies; private DependencyContainer dependencies;
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
=> dependencies = new DependencyContainer(base.CreateChildDependencies(parent)); => dependencies = new DependencyContainer(base.CreateChildDependencies(parent));
public int TotalColumns => ((ManiaPlayfield)RulesetContainer.Playfield).TotalColumns; public int TotalColumns => ((ManiaPlayfield)DrawableRuleset.Playfield).TotalColumns;
protected override RulesetContainer<ManiaHitObject> CreateRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap) protected override DrawableRuleset<ManiaHitObject> CreateDrawableRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
{ {
RulesetContainer = new ManiaEditRulesetContainer(ruleset, beatmap); DrawableRuleset = new DrawableManiaEditRuleset(ruleset, beatmap);
// This is the earliest we can cache the scrolling info to ourselves, before masks are added to the hierarchy and inject it // This is the earliest we can cache the scrolling info to ourselves, before masks are added to the hierarchy and inject it
dependencies.CacheAs(RulesetContainer.ScrollingInfo); dependencies.CacheAs(DrawableRuleset.ScrollingInfo);
return RulesetContainer; return DrawableRuleset;
} }
protected override IReadOnlyList<HitObjectCompositionTool> CompositionTools => new HitObjectCompositionTool[] protected override IReadOnlyList<HitObjectCompositionTool> CompositionTools => new HitObjectCompositionTool[]

View File

@ -31,7 +31,7 @@ namespace osu.Game.Rulesets.Mania
{ {
public class ManiaRuleset : Ruleset public class ManiaRuleset : Ruleset
{ {
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap) => new ManiaRulesetContainer(this, beatmap); public override DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap) => new DrawableManiaRuleset(this, beatmap);
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new ManiaBeatmapConverter(beatmap); public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new ManiaBeatmapConverter(beatmap);
public override PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, ScoreInfo score) => new ManiaPerformanceCalculator(this, beatmap, score); public override PerformanceCalculator CreatePerformanceCalculator(WorkingBeatmap beatmap, ScoreInfo score) => new ManiaPerformanceCalculator(this, beatmap, score);

View File

@ -92,8 +92,8 @@ namespace osu.Game.Rulesets.Mania.Scoring
{ {
} }
public ManiaScoreProcessor(RulesetContainer<ManiaHitObject> rulesetContainer) public ManiaScoreProcessor(DrawableRuleset<ManiaHitObject> rrawableRuleset)
: base(rulesetContainer) : base(rrawableRuleset)
{ {
} }

View File

@ -28,7 +28,7 @@ using osuTK;
namespace osu.Game.Rulesets.Mania.UI namespace osu.Game.Rulesets.Mania.UI
{ {
public class ManiaRulesetContainer : ScrollingRulesetContainer<ManiaPlayfield, ManiaHitObject> public class DrawableManiaRuleset : DrawableScrollingRuleset<ManiaPlayfield, ManiaHitObject>
{ {
public new ManiaBeatmap Beatmap => (ManiaBeatmap)base.Beatmap; public new ManiaBeatmap Beatmap => (ManiaBeatmap)base.Beatmap;
@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Mania.UI
private readonly Bindable<ManiaScrollingDirection> configDirection = new Bindable<ManiaScrollingDirection>(); private readonly Bindable<ManiaScrollingDirection> configDirection = new Bindable<ManiaScrollingDirection>();
public ManiaRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap) public DrawableManiaRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
: base(ruleset, beatmap) : base(ruleset, beatmap)
{ {
// Generate the bar lines // Generate the bar lines

View File

@ -8,9 +8,9 @@ using osuTK;
namespace osu.Game.Rulesets.Osu.Edit namespace osu.Game.Rulesets.Osu.Edit
{ {
public class OsuEditRulesetContainer : OsuRulesetContainer public class DrawableOsuEditRuleset : DrawableOsuRuleset
{ {
public OsuEditRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap) public DrawableOsuEditRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
: base(ruleset, beatmap) : base(ruleset, beatmap)
{ {
} }

View File

@ -26,8 +26,8 @@ namespace osu.Game.Rulesets.Osu.Edit
{ {
} }
protected override RulesetContainer<OsuHitObject> CreateRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap) protected override DrawableRuleset<OsuHitObject> CreateDrawableRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
=> new OsuEditRulesetContainer(ruleset, beatmap); => new DrawableOsuEditRuleset(ruleset, beatmap);
protected override IReadOnlyList<HitObjectCompositionTool> CompositionTools => new HitObjectCompositionTool[] protected override IReadOnlyList<HitObjectCompositionTool> CompositionTools => new HitObjectCompositionTool[]
{ {

View File

@ -18,7 +18,7 @@ using osuTK.Graphics;
namespace osu.Game.Rulesets.Osu.Mods namespace osu.Game.Rulesets.Osu.Mods
{ {
public class OsuModBlinds : Mod, IApplicableToRulesetContainer<OsuHitObject>, IApplicableToScoreProcessor public class OsuModBlinds : Mod, IApplicableToDrawableRuleset<OsuHitObject>, IApplicableToScoreProcessor
{ {
public override string Name => "Blinds"; public override string Name => "Blinds";
public override string Description => "Play with blinds on your screen."; public override string Description => "Play with blinds on your screen.";
@ -32,9 +32,9 @@ namespace osu.Game.Rulesets.Osu.Mods
public override double ScoreMultiplier => 1.12; public override double ScoreMultiplier => 1.12;
private DrawableOsuBlinds blinds; private DrawableOsuBlinds blinds;
public void ApplyToRulesetContainer(RulesetContainer<OsuHitObject> rulesetContainer) public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> rrawableRuleset)
{ {
rulesetContainer.Overlays.Add(blinds = new DrawableOsuBlinds(rulesetContainer.Playfield.HitObjectContainer, rulesetContainer.Beatmap)); rrawableRuleset.Overlays.Add(blinds = new DrawableOsuBlinds(rrawableRuleset.Playfield.HitObjectContainer, rrawableRuleset.Beatmap));
} }
public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor) public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)

View File

@ -13,7 +13,7 @@ using static osu.Game.Input.Handlers.ReplayInputHandler;
namespace osu.Game.Rulesets.Osu.Mods namespace osu.Game.Rulesets.Osu.Mods
{ {
public class OsuModRelax : ModRelax, IApplicableFailOverride, IUpdatableByPlayfield, IApplicableToRulesetContainer<OsuHitObject> public class OsuModRelax : ModRelax, IApplicableFailOverride, IUpdatableByPlayfield, IApplicableToDrawableRuleset<OsuHitObject>
{ {
public override string Description => @"You don't need to click. Give your clicking/tapping fingers a break from the heat of things."; public override string Description => @"You don't need to click. Give your clicking/tapping fingers a break from the heat of things.";
public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).ToArray(); public override Type[] IncompatibleMods => base.IncompatibleMods.Append(typeof(OsuModAutopilot)).ToArray();
@ -79,10 +79,10 @@ namespace osu.Game.Rulesets.Osu.Mods
state.Apply(osuInputManager.CurrentState, osuInputManager); state.Apply(osuInputManager.CurrentState, osuInputManager);
} }
public void ApplyToRulesetContainer(RulesetContainer<OsuHitObject> rulesetContainer) public void ApplyToDrawableRuleset(DrawableRuleset<OsuHitObject> rrawableRuleset)
{ {
// grab the input manager for future use. // grab the input manager for future use.
osuInputManager = (OsuInputManager)rulesetContainer.KeyBindingInputManager; osuInputManager = (OsuInputManager)rrawableRuleset.KeyBindingInputManager;
osuInputManager.AllowUserPresses = false; osuInputManager.AllowUserPresses = false;
} }
} }

View File

@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Osu
{ {
public class OsuRuleset : Ruleset public class OsuRuleset : Ruleset
{ {
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap) => new OsuRulesetContainer(this, beatmap); public override DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap) => new DrawableOsuRuleset(this, beatmap);
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new OsuBeatmapConverter(beatmap); public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new OsuBeatmapConverter(beatmap);
public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => new OsuBeatmapProcessor(beatmap); public override IBeatmapProcessor CreateBeatmapProcessor(IBeatmap beatmap) => new OsuBeatmapProcessor(beatmap);

View File

@ -15,8 +15,8 @@ namespace osu.Game.Rulesets.Osu.Scoring
{ {
internal class OsuScoreProcessor : ScoreProcessor<OsuHitObject> internal class OsuScoreProcessor : ScoreProcessor<OsuHitObject>
{ {
public OsuScoreProcessor(RulesetContainer<OsuHitObject> rulesetContainer) public OsuScoreProcessor(DrawableRuleset<OsuHitObject> rrawableRuleset)
: base(rulesetContainer) : base(rrawableRuleset)
{ {
} }

View File

@ -17,11 +17,11 @@ using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Osu.UI namespace osu.Game.Rulesets.Osu.UI
{ {
public class OsuRulesetContainer : RulesetContainer<OsuPlayfield, OsuHitObject> public class DrawableOsuRuleset : DrawableRuleset<OsuPlayfield, OsuHitObject>
{ {
protected new OsuRulesetConfigManager Config => (OsuRulesetConfigManager)base.Config; protected new OsuRulesetConfigManager Config => (OsuRulesetConfigManager)base.Config;
public OsuRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap) public DrawableOsuRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
: base(ruleset, beatmap) : base(ruleset, beatmap)
{ {
} }

View File

@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
protected override double TimePerAction => default_duration * 2; protected override double TimePerAction => default_duration * 2;
private readonly Random rng = new Random(1337); private readonly Random rng = new Random(1337);
private TaikoRulesetContainer rulesetContainer; private DrawableTaikoRuleset drawableRuleset;
private Container playfieldContainer; private Container playfieldContainer;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
@ -86,7 +86,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
Origin = Anchor.Centre, Origin = Anchor.Centre,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Height = 768, Height = 768,
Children = new[] { rulesetContainer = new TaikoRulesetContainer(new TaikoRuleset(), beatmap) } Children = new[] { drawableRuleset = new DrawableTaikoRuleset(new TaikoRuleset(), beatmap) }
}); });
} }
@ -139,7 +139,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
var h = new DrawableTestHit(hit) { X = RNG.NextSingle(hitResult == HitResult.Good ? -0.1f : -0.05f, hitResult == HitResult.Good ? 0.1f : 0.05f) }; var h = new DrawableTestHit(hit) { X = RNG.NextSingle(hitResult == HitResult.Good ? -0.1f : -0.05f, hitResult == HitResult.Good ? 0.1f : 0.05f) };
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(h, new JudgementResult(new TaikoJudgement()) { Type = hitResult }); ((TaikoPlayfield)drawableRuleset.Playfield).OnNewResult(h, new JudgementResult(new TaikoJudgement()) { Type = hitResult });
} }
private void addStrongHitJudgement(bool kiai) private void addStrongHitJudgement(bool kiai)
@ -154,33 +154,33 @@ namespace osu.Game.Rulesets.Taiko.Tests
var h = new DrawableTestHit(hit) { X = RNG.NextSingle(hitResult == HitResult.Good ? -0.1f : -0.05f, hitResult == HitResult.Good ? 0.1f : 0.05f) }; var h = new DrawableTestHit(hit) { X = RNG.NextSingle(hitResult == HitResult.Good ? -0.1f : -0.05f, hitResult == HitResult.Good ? 0.1f : 0.05f) };
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(h, new JudgementResult(new TaikoJudgement()) { Type = hitResult }); ((TaikoPlayfield)drawableRuleset.Playfield).OnNewResult(h, new JudgementResult(new TaikoJudgement()) { Type = hitResult });
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(new TestStrongNestedHit(h), new JudgementResult(new TaikoStrongJudgement()) { Type = HitResult.Great }); ((TaikoPlayfield)drawableRuleset.Playfield).OnNewResult(new TestStrongNestedHit(h), new JudgementResult(new TaikoStrongJudgement()) { Type = HitResult.Great });
} }
private void addMissJudgement() private void addMissJudgement()
{ {
((TaikoPlayfield)rulesetContainer.Playfield).OnNewResult(new DrawableTestHit(new Hit()), new JudgementResult(new TaikoJudgement()) { Type = HitResult.Miss }); ((TaikoPlayfield)drawableRuleset.Playfield).OnNewResult(new DrawableTestHit(new Hit()), new JudgementResult(new TaikoJudgement()) { Type = HitResult.Miss });
} }
private void addBarLine(bool major, double delay = scroll_time) private void addBarLine(bool major, double delay = scroll_time)
{ {
BarLine bl = new BarLine { StartTime = rulesetContainer.Playfield.Time.Current + delay }; BarLine bl = new BarLine { StartTime = drawableRuleset.Playfield.Time.Current + delay };
rulesetContainer.Playfield.Add(major ? new DrawableBarLineMajor(bl) : new DrawableBarLine(bl)); drawableRuleset.Playfield.Add(major ? new DrawableBarLineMajor(bl) : new DrawableBarLine(bl));
} }
private void addSwell(double duration = default_duration) private void addSwell(double duration = default_duration)
{ {
var swell = new Swell var swell = new Swell
{ {
StartTime = rulesetContainer.Playfield.Time.Current + scroll_time, StartTime = drawableRuleset.Playfield.Time.Current + scroll_time,
Duration = duration, Duration = duration,
}; };
swell.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); swell.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
rulesetContainer.Playfield.Add(new DrawableSwell(swell)); drawableRuleset.Playfield.Add(new DrawableSwell(swell));
} }
private void addDrumRoll(bool strong, double duration = default_duration) private void addDrumRoll(bool strong, double duration = default_duration)
@ -190,40 +190,40 @@ namespace osu.Game.Rulesets.Taiko.Tests
var d = new DrumRoll var d = new DrumRoll
{ {
StartTime = rulesetContainer.Playfield.Time.Current + scroll_time, StartTime = drawableRuleset.Playfield.Time.Current + scroll_time,
IsStrong = strong, IsStrong = strong,
Duration = duration, Duration = duration,
}; };
d.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); d.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
rulesetContainer.Playfield.Add(new DrawableDrumRoll(d)); drawableRuleset.Playfield.Add(new DrawableDrumRoll(d));
} }
private void addCentreHit(bool strong) private void addCentreHit(bool strong)
{ {
Hit h = new Hit Hit h = new Hit
{ {
StartTime = rulesetContainer.Playfield.Time.Current + scroll_time, StartTime = drawableRuleset.Playfield.Time.Current + scroll_time,
IsStrong = strong IsStrong = strong
}; };
h.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); h.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
rulesetContainer.Playfield.Add(new DrawableCentreHit(h)); drawableRuleset.Playfield.Add(new DrawableCentreHit(h));
} }
private void addRimHit(bool strong) private void addRimHit(bool strong)
{ {
Hit h = new Hit Hit h = new Hit
{ {
StartTime = rulesetContainer.Playfield.Time.Current + scroll_time, StartTime = drawableRuleset.Playfield.Time.Current + scroll_time,
IsStrong = strong IsStrong = strong
}; };
h.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty()); h.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty());
rulesetContainer.Playfield.Add(new DrawableRimHit(h)); drawableRuleset.Playfield.Add(new DrawableRimHit(h));
} }
private class TestStrongNestedHit : DrawableStrongNestedHit private class TestStrongNestedHit : DrawableStrongNestedHit

View File

@ -22,10 +22,10 @@ namespace osu.Game.Rulesets.Taiko.Mods
private TaikoPlayfield playfield; private TaikoPlayfield playfield;
public override void ApplyToRulesetContainer(RulesetContainer<TaikoHitObject> rulesetContainer) public override void ApplyToDrawableRuleset(DrawableRuleset<TaikoHitObject> rrawableRuleset)
{ {
playfield = (TaikoPlayfield)rulesetContainer.Playfield; playfield = (TaikoPlayfield)rrawableRuleset.Playfield;
base.ApplyToRulesetContainer(rulesetContainer); base.ApplyToDrawableRuleset(rrawableRuleset);
} }
private class TaikoFlashlight : Flashlight private class TaikoFlashlight : Flashlight

View File

@ -32,8 +32,8 @@ namespace osu.Game.Rulesets.Taiko.Scoring
/// </summary> /// </summary>
private double hpMissMultiplier; private double hpMissMultiplier;
public TaikoScoreProcessor(RulesetContainer<TaikoHitObject> rulesetContainer) public TaikoScoreProcessor(DrawableRuleset<TaikoHitObject> rrawableRuleset)
: base(rulesetContainer) : base(rrawableRuleset)
{ {
} }

View File

@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Taiko
{ {
public class TaikoRuleset : Ruleset public class TaikoRuleset : Ruleset
{ {
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap) => new TaikoRulesetContainer(this, beatmap); public override DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap) => new DrawableTaikoRuleset(this, beatmap);
public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new TaikoBeatmapConverter(beatmap); public override IBeatmapConverter CreateBeatmapConverter(IBeatmap beatmap) => new TaikoBeatmapConverter(beatmap);
public override IEnumerable<KeyBinding> GetDefaultKeyBindings(int variant = 0) => new[] public override IEnumerable<KeyBinding> GetDefaultKeyBindings(int variant = 0) => new[]

View File

@ -20,13 +20,13 @@ using osu.Game.Rulesets.UI.Scrolling;
namespace osu.Game.Rulesets.Taiko.UI namespace osu.Game.Rulesets.Taiko.UI
{ {
public class TaikoRulesetContainer : ScrollingRulesetContainer<TaikoPlayfield, TaikoHitObject> public class DrawableTaikoRuleset : DrawableScrollingRuleset<TaikoPlayfield, TaikoHitObject>
{ {
protected override ScrollVisualisationMethod VisualisationMethod => ScrollVisualisationMethod.Overlapping; protected override ScrollVisualisationMethod VisualisationMethod => ScrollVisualisationMethod.Overlapping;
protected override bool UserScrollSpeedAdjustment => false; protected override bool UserScrollSpeedAdjustment => false;
public TaikoRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap) public DrawableTaikoRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
: base(ruleset, beatmap) : base(ruleset, beatmap)
{ {
Direction.Value = ScrollingDirection.Left; Direction.Value = ScrollingDirection.Left;

View File

@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Taiko.UI
public class TaikoPlayfield : ScrollingPlayfield public class TaikoPlayfield : ScrollingPlayfield
{ {
/// <summary> /// <summary>
/// Default height of a <see cref="TaikoPlayfield"/> when inside a <see cref="TaikoRulesetContainer"/>. /// Default height of a <see cref="TaikoPlayfield"/> when inside a <see cref="DrawableTaikoRuleset"/>.
/// </summary> /// </summary>
public const float DEFAULT_HEIGHT = 178; public const float DEFAULT_HEIGHT = 178;

View File

@ -350,7 +350,7 @@ namespace osu.Game.Tests.Visual
Thread.Sleep(1); Thread.Sleep(1);
StoryboardEnabled = config.GetBindable<bool>(OsuSetting.ShowStoryboard); StoryboardEnabled = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
ReplacesBackground.BindTo(Background.StoryboardReplacesBackground); ReplacesBackground.BindTo(Background.StoryboardReplacesBackground);
RulesetContainer.IsPaused.BindTo(IsPaused); DrawableRuleset.IsPaused.BindTo(IsPaused);
} }
} }

View File

@ -52,7 +52,7 @@ namespace osu.Game.Beatmaps
{ {
public override IEnumerable<Mod> GetModsFor(ModType type) => new Mod[] { }; public override IEnumerable<Mod> GetModsFor(ModType type) => new Mod[] { };
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap) public override DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

View File

@ -11,14 +11,14 @@ using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Edit namespace osu.Game.Rulesets.Edit
{ {
public abstract class EditRulesetContainer : CompositeDrawable public abstract class EditDrawableRuleset : CompositeDrawable
{ {
/// <summary> /// <summary>
/// The <see cref="Playfield"/> contained by this <see cref="EditRulesetContainer"/>. /// The <see cref="Playfield"/> contained by this <see cref="EditDrawableRuleset"/>.
/// </summary> /// </summary>
public abstract Playfield Playfield { get; } public abstract Playfield Playfield { get; }
internal EditRulesetContainer() internal EditDrawableRuleset()
{ {
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
} }
@ -38,21 +38,21 @@ namespace osu.Game.Rulesets.Edit
internal abstract DrawableHitObject Remove(HitObject hitObject); internal abstract DrawableHitObject Remove(HitObject hitObject);
} }
public class EditRulesetContainer<TObject> : EditRulesetContainer public class EditDrawableRuleset<TObject> : EditDrawableRuleset
where TObject : HitObject where TObject : HitObject
{ {
public override Playfield Playfield => rulesetContainer.Playfield; public override Playfield Playfield => rrawableRuleset.Playfield;
private Ruleset ruleset => rulesetContainer.Ruleset; private Ruleset ruleset => rrawableRuleset.Ruleset;
private Beatmap<TObject> beatmap => rulesetContainer.Beatmap; private Beatmap<TObject> beatmap => rrawableRuleset.Beatmap;
private readonly RulesetContainer<TObject> rulesetContainer; private readonly DrawableRuleset<TObject> rrawableRuleset;
public EditRulesetContainer(RulesetContainer<TObject> rulesetContainer) public EditDrawableRuleset(DrawableRuleset<TObject> rrawableRuleset)
{ {
this.rulesetContainer = rulesetContainer; this.rrawableRuleset = rrawableRuleset;
InternalChild = rulesetContainer; InternalChild = rrawableRuleset;
Playfield.DisplayJudgements.Value = false; Playfield.DisplayJudgements.Value = false;
} }
@ -73,10 +73,10 @@ namespace osu.Game.Rulesets.Edit
processor?.PostProcess(); processor?.PostProcess();
// Add visual representation // Add visual representation
var drawableObject = rulesetContainer.GetVisualRepresentation(tObject); var drawableObject = rrawableRuleset.GetVisualRepresentation(tObject);
rulesetContainer.Playfield.Add(drawableObject); rrawableRuleset.Playfield.Add(drawableObject);
rulesetContainer.Playfield.PostProcess(); rrawableRuleset.Playfield.PostProcess();
return drawableObject; return drawableObject;
} }
@ -97,8 +97,8 @@ namespace osu.Game.Rulesets.Edit
// Remove visual representation // Remove visual representation
var drawableObject = Playfield.AllHitObjects.Single(d => d.HitObject == hitObject); var drawableObject = Playfield.AllHitObjects.Single(d => d.HitObject == hitObject);
rulesetContainer.Playfield.Remove(drawableObject); rrawableRuleset.Playfield.Remove(drawableObject);
rulesetContainer.Playfield.PostProcess(); rrawableRuleset.Playfield.PostProcess();
return drawableObject; return drawableObject;
} }

View File

@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Edit
{ {
public abstract class HitObjectComposer : CompositeDrawable public abstract class HitObjectComposer : CompositeDrawable
{ {
public IEnumerable<DrawableHitObject> HitObjects => RulesetContainer.Playfield.AllHitObjects; public IEnumerable<DrawableHitObject> HitObjects => DrawableRuleset.Playfield.AllHitObjects;
protected readonly Ruleset Ruleset; protected readonly Ruleset Ruleset;
@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Edit
private readonly List<Container> layerContainers = new List<Container>(); private readonly List<Container> layerContainers = new List<Container>();
protected EditRulesetContainer RulesetContainer { get; private set; } protected EditDrawableRuleset DrawableRuleset { get; private set; }
private BlueprintContainer blueprintContainer; private BlueprintContainer blueprintContainer;
@ -54,8 +54,8 @@ namespace osu.Game.Rulesets.Edit
try try
{ {
RulesetContainer = CreateRulesetContainer(); DrawableRuleset = CreateDrawableRuleset();
RulesetContainer.Clock = framedClock; DrawableRuleset.Clock = framedClock;
} }
catch (Exception e) catch (Exception e)
{ {
@ -97,7 +97,7 @@ namespace osu.Game.Rulesets.Edit
Children = new Drawable[] Children = new Drawable[]
{ {
layerBelowRuleset, layerBelowRuleset,
RulesetContainer, DrawableRuleset,
layerAboveRuleset layerAboveRuleset
} }
} }
@ -140,27 +140,27 @@ namespace osu.Game.Rulesets.Edit
layerContainers.ForEach(l => layerContainers.ForEach(l =>
{ {
l.Anchor = RulesetContainer.Playfield.Anchor; l.Anchor = DrawableRuleset.Playfield.Anchor;
l.Origin = RulesetContainer.Playfield.Origin; l.Origin = DrawableRuleset.Playfield.Origin;
l.Position = RulesetContainer.Playfield.Position; l.Position = DrawableRuleset.Playfield.Position;
l.Size = RulesetContainer.Playfield.Size; l.Size = DrawableRuleset.Playfield.Size;
}); });
} }
/// <summary> /// <summary>
/// Whether the user's cursor is currently in an area of the <see cref="HitObjectComposer"/> that is valid for placement. /// Whether the user's cursor is currently in an area of the <see cref="HitObjectComposer"/> that is valid for placement.
/// </summary> /// </summary>
public virtual bool CursorInPlacementArea => RulesetContainer.Playfield.ReceivePositionalInputAt(inputManager.CurrentState.Mouse.Position); public virtual bool CursorInPlacementArea => DrawableRuleset.Playfield.ReceivePositionalInputAt(inputManager.CurrentState.Mouse.Position);
/// <summary> /// <summary>
/// Adds a <see cref="HitObject"/> to the <see cref="Beatmaps.Beatmap"/> and visualises it. /// Adds a <see cref="HitObject"/> to the <see cref="Beatmaps.Beatmap"/> and visualises it.
/// </summary> /// </summary>
/// <param name="hitObject">The <see cref="HitObject"/> to add.</param> /// <param name="hitObject">The <see cref="HitObject"/> to add.</param>
public void Add(HitObject hitObject) => blueprintContainer.AddBlueprintFor(RulesetContainer.Add(hitObject)); public void Add(HitObject hitObject) => blueprintContainer.AddBlueprintFor(DrawableRuleset.Add(hitObject));
public void Remove(HitObject hitObject) => blueprintContainer.RemoveBlueprintFor(RulesetContainer.Remove(hitObject)); public void Remove(HitObject hitObject) => blueprintContainer.RemoveBlueprintFor(DrawableRuleset.Remove(hitObject));
internal abstract EditRulesetContainer CreateRulesetContainer(); internal abstract EditDrawableRuleset CreateDrawableRuleset();
protected abstract IReadOnlyList<HitObjectCompositionTool> CompositionTools { get; } protected abstract IReadOnlyList<HitObjectCompositionTool> CompositionTools { get; }
@ -189,9 +189,9 @@ namespace osu.Game.Rulesets.Edit
{ {
} }
internal override EditRulesetContainer CreateRulesetContainer() internal override EditDrawableRuleset CreateDrawableRuleset()
=> new EditRulesetContainer<TObject>(CreateRulesetContainer(Ruleset, Beatmap.Value)); => new EditDrawableRuleset<TObject>(CreateDrawableRuleset(Ruleset, Beatmap.Value));
protected abstract RulesetContainer<TObject> CreateRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap); protected abstract DrawableRuleset<TObject> CreateDrawableRuleset(Ruleset ruleset, WorkingBeatmap beatmap);
} }
} }

View File

@ -7,15 +7,15 @@ using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods
{ {
/// <summary> /// <summary>
/// An interface for <see cref="Mod"/>s that can be applied to <see cref="RulesetContainer"/>s. /// An interface for <see cref="Mod"/>s that can be applied to <see cref="DrawableRuleset"/>s.
/// </summary> /// </summary>
public interface IApplicableToRulesetContainer<TObject> : IApplicableMod public interface IApplicableToDrawableRuleset<TObject> : IApplicableMod
where TObject : HitObject where TObject : HitObject
{ {
/// <summary> /// <summary>
/// Applies this <see cref="IApplicableToRulesetContainer{TObject}"/> to a <see cref="RulesetContainer{TObject}"/>. /// Applies this <see cref="IApplicableToDrawableRuleset{TObject}"/> to a <see cref="DrawableRuleset{TObject}"/>.
/// </summary> /// </summary>
/// <param name="rulesetContainer">The <see cref="RulesetContainer{TObject}"/> to apply to.</param> /// <param name="rrawableRuleset">The <see cref="DrawableRuleset{TObject}"/> to apply to.</param>
void ApplyToRulesetContainer(RulesetContainer<TObject> rulesetContainer); void ApplyToDrawableRuleset(DrawableRuleset<TObject> rrawableRuleset);
} }
} }

View File

@ -11,10 +11,10 @@ using osu.Game.Scoring;
namespace osu.Game.Rulesets.Mods namespace osu.Game.Rulesets.Mods
{ {
public abstract class ModAutoplay<T> : ModAutoplay, IApplicableToRulesetContainer<T> public abstract class ModAutoplay<T> : ModAutoplay, IApplicableToDrawableRuleset<T>
where T : HitObject where T : HitObject
{ {
public virtual void ApplyToRulesetContainer(RulesetContainer<T> rulesetContainer) => rulesetContainer.SetReplayScore(CreateReplayScore(rulesetContainer.Beatmap)); public virtual void ApplyToDrawableRuleset(DrawableRuleset<T> rrawableRuleset) => rrawableRuleset.SetReplayScore(CreateReplayScore(rrawableRuleset.Beatmap));
} }
public abstract class ModAutoplay : Mod, IApplicableFailOverride public abstract class ModAutoplay : Mod, IApplicableFailOverride

View File

@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Mods
} }
} }
public abstract class ModFlashlight<T> : ModFlashlight, IApplicableToRulesetContainer<T>, IApplicableToScoreProcessor public abstract class ModFlashlight<T> : ModFlashlight, IApplicableToDrawableRuleset<T>, IApplicableToScoreProcessor
where T : HitObject where T : HitObject
{ {
public const double FLASHLIGHT_FADE_DURATION = 800; public const double FLASHLIGHT_FADE_DURATION = 800;
@ -45,15 +45,15 @@ namespace osu.Game.Rulesets.Mods
Combo.BindTo(scoreProcessor.Combo); Combo.BindTo(scoreProcessor.Combo);
} }
public virtual void ApplyToRulesetContainer(RulesetContainer<T> rulesetContainer) public virtual void ApplyToDrawableRuleset(DrawableRuleset<T> rrawableRuleset)
{ {
var flashlight = CreateFlashlight(); var flashlight = CreateFlashlight();
flashlight.Combo = Combo; flashlight.Combo = Combo;
flashlight.RelativeSizeAxes = Axes.Both; flashlight.RelativeSizeAxes = Axes.Both;
flashlight.Colour = Color4.Black; flashlight.Colour = Color4.Black;
rulesetContainer.KeyBindingInputManager.Add(flashlight); rrawableRuleset.KeyBindingInputManager.Add(flashlight);
flashlight.Breaks = rulesetContainer.Beatmap.Breaks; flashlight.Breaks = rrawableRuleset.Beatmap.Breaks;
} }
public abstract Flashlight CreateFlashlight(); public abstract Flashlight CreateFlashlight();

View File

@ -55,7 +55,7 @@ namespace osu.Game.Rulesets
/// <param name="beatmap">The beatmap to create the hit renderer for.</param> /// <param name="beatmap">The beatmap to create the hit renderer for.</param>
/// <exception cref="BeatmapInvalidForRulesetException">Unable to successfully load the beatmap to be usable with this ruleset.</exception> /// <exception cref="BeatmapInvalidForRulesetException">Unable to successfully load the beatmap to be usable with this ruleset.</exception>
/// <returns></returns> /// <returns></returns>
public abstract RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap); public abstract DrawableRuleset CreateDrawableRulesetWith(WorkingBeatmap beatmap);
/// <summary> /// <summary>
/// Creates a <see cref="IBeatmapConverter"/> to convert a <see cref="IBeatmap"/> to one that is applicable for this <see cref="Ruleset"/>. /// Creates a <see cref="IBeatmapConverter"/> to convert a <see cref="IBeatmap"/> to one that is applicable for this <see cref="Ruleset"/>.

View File

@ -210,15 +210,15 @@ namespace osu.Game.Rulesets.Scoring
{ {
} }
public ScoreProcessor(RulesetContainer<TObject> rulesetContainer) public ScoreProcessor(DrawableRuleset<TObject> rrawableRuleset)
{ {
Debug.Assert(base_portion + combo_portion == 1.0); Debug.Assert(base_portion + combo_portion == 1.0);
rulesetContainer.OnNewResult += applyResult; rrawableRuleset.OnNewResult += applyResult;
rulesetContainer.OnRevertResult += revertResult; rrawableRuleset.OnRevertResult += revertResult;
ApplyBeatmap(rulesetContainer.Beatmap); ApplyBeatmap(rrawableRuleset.Beatmap);
SimulateAutoplay(rulesetContainer.Beatmap); SimulateAutoplay(rrawableRuleset.Beatmap);
Reset(true); Reset(true);
if (maxBaseScore == 0 || maxHighestCombo == 0) if (maxBaseScore == 0 || maxHighestCombo == 0)

View File

@ -30,14 +30,14 @@ using osu.Game.Screens.Play;
namespace osu.Game.Rulesets.UI namespace osu.Game.Rulesets.UI
{ {
/// <summary> /// <summary>
/// RulesetContainer that applies conversion to Beatmaps. Does not contain a Playfield /// DrawableRuleset that applies conversion to Beatmaps. Does not contain a Playfield
/// and does not load drawable hit objects. /// and does not load drawable hit objects.
/// <para> /// <para>
/// Should not be derived - derive <see cref="RulesetContainer{TPlayfield, TObject}"/> instead. /// Should not be derived - derive <see cref="DrawableRuleset{TPlayfield,TObject}"/> instead.
/// </para> /// </para>
/// </summary> /// </summary>
/// <typeparam name="TObject">The type of HitObject contained by this RulesetContainer.</typeparam> /// <typeparam name="TObject">The type of HitObject contained by this DrawableRuleset.</typeparam>
public abstract class RulesetContainer<TObject> : RulesetContainer, IProvideCursor, ICanAttachKeyCounter public abstract class DrawableRuleset<TObject> : DrawableRuleset, IProvideCursor, ICanAttachKeyCounter
where TObject : HitObject where TObject : HitObject
{ {
/// <summary> /// <summary>
@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.UI
public virtual int Variant => 0; public virtual int Variant => 0;
/// <summary> /// <summary>
/// The key conversion input manager for this RulesetContainer. /// The key conversion input manager for this DrawableRuleset.
/// </summary> /// </summary>
public PassThroughInputManager KeyBindingInputManager; public PassThroughInputManager KeyBindingInputManager;
@ -79,10 +79,10 @@ namespace osu.Game.Rulesets.UI
/// </summary> /// </summary>
/// <param name="ruleset">The ruleset being repesented.</param> /// <param name="ruleset">The ruleset being repesented.</param>
/// <param name="workingBeatmap">The beatmap to create the hit renderer for.</param> /// <param name="workingBeatmap">The beatmap to create the hit renderer for.</param>
protected RulesetContainer(Ruleset ruleset, WorkingBeatmap workingBeatmap) protected DrawableRuleset(Ruleset ruleset, WorkingBeatmap workingBeatmap)
: base(ruleset) : base(ruleset)
{ {
Debug.Assert(workingBeatmap != null, "RulesetContainer initialized with a null beatmap."); Debug.Assert(workingBeatmap != null, "DrawableRuleset initialized with a null beatmap.");
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
@ -134,7 +134,7 @@ namespace osu.Game.Rulesets.UI
} }
/// <summary> /// <summary>
/// Creates and adds the visual representation of a <see cref="TObject"/> to this <see cref="RulesetContainer{TObject}"/>. /// Creates and adds the visual representation of a <see cref="TObject"/> to this <see cref="DrawableRuleset{TObject}"/>.
/// </summary> /// </summary>
/// <param name="hitObject">The <see cref="TObject"/> to add the visual representation for.</param> /// <param name="hitObject">The <see cref="TObject"/> to add the visual representation for.</param>
private void addRepresentation(TObject hitObject) private void addRepresentation(TObject hitObject)
@ -253,7 +253,7 @@ namespace osu.Game.Rulesets.UI
} }
/// <summary> /// <summary>
/// Applies the active mods to this RulesetContainer. /// Applies the active mods to this DrawableRuleset.
/// </summary> /// </summary>
/// <param name="mods"></param> /// <param name="mods"></param>
private void applyRulesetMods(IEnumerable<Mod> mods, OsuConfigManager config) private void applyRulesetMods(IEnumerable<Mod> mods, OsuConfigManager config)
@ -261,8 +261,8 @@ namespace osu.Game.Rulesets.UI
if (mods == null) if (mods == null)
return; return;
foreach (var mod in mods.OfType<IApplicableToRulesetContainer<TObject>>()) foreach (var mod in mods.OfType<IApplicableToDrawableRuleset<TObject>>())
mod.ApplyToRulesetContainer(this); mod.ApplyToDrawableRuleset(this);
foreach (var mod in mods.OfType<IReadFromConfig>()) foreach (var mod in mods.OfType<IReadFromConfig>())
mod.ReadFromConfig(config); mod.ReadFromConfig(config);
@ -281,12 +281,12 @@ namespace osu.Game.Rulesets.UI
} }
/// <summary> /// <summary>
/// Base RulesetContainer. Doesn't hold objects. /// Base DrawableRuleset. Doesn't hold objects.
/// <para> /// <para>
/// Should not be derived - derive <see cref="RulesetContainer{TObject}"/> instead. /// Should not be derived - derive <see cref="DrawableRuleset{TObject}"/> instead.
/// </para> /// </para>
/// </summary> /// </summary>
public abstract class RulesetContainer : CompositeDrawable public abstract class DrawableRuleset : CompositeDrawable
{ {
/// <summary> /// <summary>
/// Whether a replay is currently loaded. /// Whether a replay is currently loaded.
@ -307,7 +307,7 @@ namespace osu.Game.Rulesets.UI
/// Creates a ruleset visualisation for the provided ruleset. /// Creates a ruleset visualisation for the provided ruleset.
/// </summary> /// </summary>
/// <param name="ruleset">The ruleset.</param> /// <param name="ruleset">The ruleset.</param>
protected RulesetContainer(Ruleset ruleset) protected DrawableRuleset(Ruleset ruleset)
{ {
Ruleset = ruleset; Ruleset = ruleset;
} }
@ -341,18 +341,18 @@ namespace osu.Game.Rulesets.UI
/// <summary> /// <summary>
/// Create a <see cref="ScoreProcessor"/> for the associated ruleset and link with this /// Create a <see cref="ScoreProcessor"/> for the associated ruleset and link with this
/// <see cref="RulesetContainer"/>. /// <see cref="DrawableRuleset"/>.
/// </summary> /// </summary>
/// <returns>A score processor.</returns> /// <returns>A score processor.</returns>
public abstract ScoreProcessor CreateScoreProcessor(); public abstract ScoreProcessor CreateScoreProcessor();
} }
/// <summary> /// <summary>
/// A derivable RulesetContainer that manages the Playfield and HitObjects. /// A derivable DrawableRuleset that manages the Playfield and HitObjects.
/// </summary> /// </summary>
/// <typeparam name="TPlayfield">The type of Playfield contained by this RulesetContainer.</typeparam> /// <typeparam name="TPlayfield">The type of Playfield contained by this DrawableRuleset.</typeparam>
/// <typeparam name="TObject">The type of HitObject contained by this RulesetContainer.</typeparam> /// <typeparam name="TObject">The type of HitObject contained by this DrawableRuleset.</typeparam>
public abstract class RulesetContainer<TPlayfield, TObject> : RulesetContainer<TObject> public abstract class DrawableRuleset<TPlayfield, TObject> : DrawableRuleset<TObject>
where TObject : HitObject where TObject : HitObject
where TPlayfield : Playfield where TPlayfield : Playfield
{ {
@ -366,7 +366,7 @@ namespace osu.Game.Rulesets.UI
/// </summary> /// </summary>
/// <param name="ruleset">The ruleset being repesented.</param> /// <param name="ruleset">The ruleset being repesented.</param>
/// <param name="beatmap">The beatmap to create the hit renderer for.</param> /// <param name="beatmap">The beatmap to create the hit renderer for.</param>
protected RulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap) protected DrawableRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
: base(ruleset, beatmap) : base(ruleset, beatmap)
{ {
} }

View File

@ -20,10 +20,10 @@ using osu.Game.Rulesets.UI.Scrolling.Algorithms;
namespace osu.Game.Rulesets.UI.Scrolling namespace osu.Game.Rulesets.UI.Scrolling
{ {
/// <summary> /// <summary>
/// A type of <see cref="RulesetContainer{TPlayfield,TObject}"/> that supports a <see cref="ScrollingPlayfield"/>. /// A type of <see cref="DrawableRuleset{TPlayfield,TObject}"/> that supports a <see cref="ScrollingPlayfield"/>.
/// <see cref="HitObject"/>s inside this <see cref="RulesetContainer{TPlayfield,TObject}"/> will scroll within the playfield. /// <see cref="HitObject"/>s inside this <see cref="DrawableRuleset{TPlayfield,TObject}"/> will scroll within the playfield.
/// </summary> /// </summary>
public abstract class ScrollingRulesetContainer<TPlayfield, TObject> : RulesetContainer<TPlayfield, TObject>, IKeyBindingHandler<GlobalAction> public abstract class DrawableScrollingRuleset<TPlayfield, TObject> : DrawableRuleset<TPlayfield, TObject>, IKeyBindingHandler<GlobalAction>
where TObject : HitObject where TObject : HitObject
where TPlayfield : ScrollingPlayfield where TPlayfield : ScrollingPlayfield
{ {
@ -70,7 +70,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
/// <summary> /// <summary>
/// Provides the default <see cref="MultiplierControlPoint"/>s that adjust the scrolling rate of <see cref="HitObject"/>s /// Provides the default <see cref="MultiplierControlPoint"/>s that adjust the scrolling rate of <see cref="HitObject"/>s
/// inside this <see cref="RulesetContainer{TPlayfield,TObject}"/>. /// inside this <see cref="DrawableRuleset{TPlayfield,TObject}"/>.
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
private readonly SortedList<MultiplierControlPoint> controlPoints = new SortedList<MultiplierControlPoint>(Comparer<MultiplierControlPoint>.Default); private readonly SortedList<MultiplierControlPoint> controlPoints = new SortedList<MultiplierControlPoint>(Comparer<MultiplierControlPoint>.Default);
@ -80,7 +80,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
[Cached(Type = typeof(IScrollingInfo))] [Cached(Type = typeof(IScrollingInfo))]
private readonly LocalScrollingInfo scrollingInfo; private readonly LocalScrollingInfo scrollingInfo;
protected ScrollingRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap) protected DrawableScrollingRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
: base(ruleset, beatmap) : base(ruleset, beatmap)
{ {
scrollingInfo = new LocalScrollingInfo(); scrollingInfo = new LocalScrollingInfo();

View File

@ -55,7 +55,7 @@ namespace osu.Game.Screens.Edit
{ {
this.host = host; this.host = host;
// TODO: should probably be done at a RulesetContainer level to share logic with Player. // TODO: should probably be done at a DrawableRuleset level to share logic with Player.
var sourceClock = (IAdjustableClock)Beatmap.Value.Track ?? new StopwatchClock(); var sourceClock = (IAdjustableClock)Beatmap.Value.Track ?? new StopwatchClock();
clock = new EditorClock(Beatmap.Value, beatDivisor) { IsCoupled = false }; clock = new EditorClock(Beatmap.Value, beatDivisor) { IsCoupled = false };
clock.ChangeSource(sourceClock); clock.ChangeSource(sourceClock);

View File

@ -15,7 +15,7 @@ namespace osu.Game.Screens.Multi.Components
private const float height = 30; private const float height = 30;
private const float transition_duration = 100; private const float transition_duration = 100;
private Container rulesetContainer; private Container drawableRuleset;
public ModeTypeInfo() public ModeTypeInfo()
{ {
@ -35,7 +35,7 @@ namespace osu.Game.Screens.Multi.Components
LayoutDuration = 100, LayoutDuration = 100,
Children = new[] Children = new[]
{ {
rulesetContainer = new Container drawableRuleset = new Container
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
}, },
@ -55,11 +55,11 @@ namespace osu.Game.Screens.Multi.Components
{ {
if (item?.Beatmap != null) if (item?.Beatmap != null)
{ {
rulesetContainer.FadeIn(transition_duration); drawableRuleset.FadeIn(transition_duration);
rulesetContainer.Child = new DifficultyIcon(item.Beatmap, item.Ruleset) { Size = new Vector2(height) }; drawableRuleset.Child = new DifficultyIcon(item.Beatmap, item.Ruleset) { Size = new Vector2(height) };
} }
else else
rulesetContainer.FadeOut(transition_duration); drawableRuleset.FadeOut(transition_duration);
} }
} }
} }

View File

@ -42,7 +42,7 @@ namespace osu.Game.Screens.Play
public Action<double> RequestSeek; public Action<double> RequestSeek;
public HUDOverlay(ScoreProcessor scoreProcessor, RulesetContainer rulesetContainer, WorkingBeatmap working) public HUDOverlay(ScoreProcessor scoreProcessor, DrawableRuleset drawableRuleset, WorkingBeatmap working)
{ {
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
@ -90,10 +90,10 @@ namespace osu.Game.Screens.Play
}; };
BindProcessor(scoreProcessor); BindProcessor(scoreProcessor);
BindRulesetContainer(rulesetContainer); BindDrawableRuleset(drawableRuleset);
Progress.Objects = rulesetContainer.Objects; Progress.Objects = drawableRuleset.Objects;
Progress.AllowSeeking = rulesetContainer.HasReplayLoaded.Value; Progress.AllowSeeking = drawableRuleset.HasReplayLoaded.Value;
Progress.RequestSeek = time => RequestSeek(time); Progress.RequestSeek = time => RequestSeek(time);
ModDisplay.Current.BindTo(working.Mods); ModDisplay.Current.BindTo(working.Mods);
@ -143,13 +143,13 @@ namespace osu.Game.Screens.Play
} }
} }
protected virtual void BindRulesetContainer(RulesetContainer rulesetContainer) protected virtual void BindDrawableRuleset(DrawableRuleset drawableRuleset)
{ {
(rulesetContainer as ICanAttachKeyCounter)?.Attach(KeyCounter); (drawableRuleset as ICanAttachKeyCounter)?.Attach(KeyCounter);
replayLoaded.BindTo(rulesetContainer.HasReplayLoaded); replayLoaded.BindTo(drawableRuleset.HasReplayLoaded);
Progress.BindRulestContainer(rulesetContainer); Progress.BindRulestContainer(drawableRuleset);
} }
protected override bool OnKeyDown(KeyDownEvent e) protected override bool OnKeyDown(KeyDownEvent e)

View File

@ -65,7 +65,7 @@ namespace osu.Game.Screens.Play
private SampleChannel sampleRestart; private SampleChannel sampleRestart;
protected ScoreProcessor ScoreProcessor { get; private set; } protected ScoreProcessor ScoreProcessor { get; private set; }
protected RulesetContainer RulesetContainer { get; private set; } protected DrawableRuleset DrawableRuleset { get; private set; }
protected HUDOverlay HUDOverlay { get; private set; } protected HUDOverlay HUDOverlay { get; private set; }
private FailOverlay failOverlay; private FailOverlay failOverlay;
@ -80,7 +80,7 @@ namespace osu.Game.Screens.Play
EnableUserDim = { Value = true } EnableUserDim = { Value = true }
}; };
public bool LoadedBeatmapSuccessfully => RulesetContainer?.Objects.Any() == true; public bool LoadedBeatmapSuccessfully => DrawableRuleset?.Objects.Any() == true;
private GameplayClockContainer gameplayClockContainer; private GameplayClockContainer gameplayClockContainer;
@ -98,11 +98,11 @@ namespace osu.Game.Screens.Play
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel); mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
ScoreProcessor = RulesetContainer.CreateScoreProcessor(); ScoreProcessor = DrawableRuleset.CreateScoreProcessor();
if (!ScoreProcessor.Mode.Disabled) if (!ScoreProcessor.Mode.Disabled)
config.BindWith(OsuSetting.ScoreDisplayMode, ScoreProcessor.Mode); config.BindWith(OsuSetting.ScoreDisplayMode, ScoreProcessor.Mode);
InternalChild = gameplayClockContainer = new GameplayClockContainer(working, AllowLeadIn, RulesetContainer.GameplayStartTime); InternalChild = gameplayClockContainer = new GameplayClockContainer(working, AllowLeadIn, DrawableRuleset.GameplayStartTime);
gameplayClockContainer.Children = new Drawable[] gameplayClockContainer.Children = new Drawable[]
{ {
@ -114,7 +114,7 @@ namespace osu.Game.Screens.Play
Start = gameplayClockContainer.Start, Start = gameplayClockContainer.Start,
Stop = gameplayClockContainer.Stop, Stop = gameplayClockContainer.Stop,
IsPaused = { BindTarget = gameplayClockContainer.IsPaused }, IsPaused = { BindTarget = gameplayClockContainer.IsPaused },
CheckCanPause = () => AllowPause && ValidForResume && !HasFailed && !RulesetContainer.HasReplayLoaded.Value, CheckCanPause = () => AllowPause && ValidForResume && !HasFailed && !DrawableRuleset.HasReplayLoaded.Value,
Children = new[] Children = new[]
{ {
StoryboardContainer = CreateStoryboardContainer(), StoryboardContainer = CreateStoryboardContainer(),
@ -123,7 +123,7 @@ namespace osu.Game.Screens.Play
Child = new LocalSkinOverrideContainer(working.Skin) Child = new LocalSkinOverrideContainer(working.Skin)
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Child = RulesetContainer Child = DrawableRuleset
} }
}, },
new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor) new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor)
@ -133,17 +133,17 @@ namespace osu.Game.Screens.Play
Breaks = working.Beatmap.Breaks Breaks = working.Beatmap.Breaks
}, },
// display the cursor above some HUD elements. // display the cursor above some HUD elements.
RulesetContainer.Cursor?.CreateProxy() ?? new Container(), DrawableRuleset.Cursor?.CreateProxy() ?? new Container(),
HUDOverlay = new HUDOverlay(ScoreProcessor, RulesetContainer, working) HUDOverlay = new HUDOverlay(ScoreProcessor, DrawableRuleset, working)
{ {
HoldToQuit = { Action = performUserRequestedExit }, HoldToQuit = { Action = performUserRequestedExit },
PlayerSettingsOverlay = { PlaybackSettings = { UserPlaybackRate = { BindTarget = gameplayClockContainer.UserPlaybackRate } } }, PlayerSettingsOverlay = { PlaybackSettings = { UserPlaybackRate = { BindTarget = gameplayClockContainer.UserPlaybackRate } } },
KeyCounter = { Visible = { BindTarget = RulesetContainer.HasReplayLoaded } }, KeyCounter = { Visible = { BindTarget = DrawableRuleset.HasReplayLoaded } },
RequestSeek = gameplayClockContainer.Seek, RequestSeek = gameplayClockContainer.Seek,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre Origin = Anchor.Centre
}, },
new SkipOverlay(RulesetContainer.GameplayStartTime) new SkipOverlay(DrawableRuleset.GameplayStartTime)
{ {
RequestSeek = gameplayClockContainer.Seek RequestSeek = gameplayClockContainer.Seek
}, },
@ -167,7 +167,7 @@ namespace osu.Game.Screens.Play
}; };
// bind clock into components that require it // bind clock into components that require it
RulesetContainer.IsPaused.BindTo(gameplayClockContainer.IsPaused); DrawableRuleset.IsPaused.BindTo(gameplayClockContainer.IsPaused);
if (ShowStoryboard.Value) if (ShowStoryboard.Value)
initializeStoryboard(false); initializeStoryboard(false);
@ -198,18 +198,18 @@ namespace osu.Game.Screens.Play
try try
{ {
RulesetContainer = rulesetInstance.CreateRulesetContainerWith(working); DrawableRuleset = rulesetInstance.CreateDrawableRulesetWith(working);
} }
catch (BeatmapInvalidForRulesetException) catch (BeatmapInvalidForRulesetException)
{ {
// we may fail to create a RulesetContainer if the beatmap cannot be loaded with the user's preferred ruleset // we may fail to create a DrawableRuleset if the beatmap cannot be loaded with the user's preferred ruleset
// let's try again forcing the beatmap's ruleset. // let's try again forcing the beatmap's ruleset.
ruleset = beatmap.BeatmapInfo.Ruleset; ruleset = beatmap.BeatmapInfo.Ruleset;
rulesetInstance = ruleset.CreateInstance(); rulesetInstance = ruleset.CreateInstance();
RulesetContainer = rulesetInstance.CreateRulesetContainerWith(Beatmap.Value); DrawableRuleset = rulesetInstance.CreateDrawableRulesetWith(Beatmap.Value);
} }
if (!RulesetContainer.Objects.Any()) if (!DrawableRuleset.Objects.Any())
{ {
Logger.Log("Beatmap contains no hit objects!", level: LogLevel.Error); Logger.Log("Beatmap contains no hit objects!", level: LogLevel.Error);
return null; return null;
@ -261,7 +261,7 @@ namespace osu.Game.Screens.Play
if (!this.IsCurrentScreen()) return; if (!this.IsCurrentScreen()) return;
var score = CreateScore(); var score = CreateScore();
if (RulesetContainer.ReplayScore == null) if (DrawableRuleset.ReplayScore == null)
scoreManager.Import(score); scoreManager.Import(score);
this.Push(CreateResults(score)); this.Push(CreateResults(score));
@ -273,7 +273,7 @@ namespace osu.Game.Screens.Play
protected virtual ScoreInfo CreateScore() protected virtual ScoreInfo CreateScore()
{ {
var score = RulesetContainer.ReplayScore?.ScoreInfo ?? new ScoreInfo var score = DrawableRuleset.ReplayScore?.ScoreInfo ?? new ScoreInfo
{ {
Beatmap = Beatmap.Value.BeatmapInfo, Beatmap = Beatmap.Value.BeatmapInfo,
Ruleset = ruleset, Ruleset = ruleset,
@ -346,7 +346,7 @@ namespace osu.Game.Screens.Play
return true; return true;
} }
if ((!AllowPause || HasFailed || !ValidForResume || PausableGameplayContainer?.IsPaused.Value != false || RulesetContainer?.HasReplayLoaded.Value != false) && (!PausableGameplayContainer?.IsResuming ?? true)) if ((!AllowPause || HasFailed || !ValidForResume || PausableGameplayContainer?.IsPaused.Value != false || DrawableRuleset?.HasReplayLoaded.Value != false) && (!PausableGameplayContainer?.IsResuming ?? true))
{ {
gameplayClockContainer.ResetLocalAdjustments(); gameplayClockContainer.ResetLocalAdjustments();

View File

@ -17,7 +17,7 @@ namespace osu.Game.Screens.Play
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
RulesetContainer?.SetReplayScore(score); DrawableRuleset?.SetReplayScore(score);
} }
protected override ScoreInfo CreateScore() => score.ScoreInfo; protected override ScoreInfo CreateScore() => score.ScoreInfo;

View File

@ -109,9 +109,9 @@ namespace osu.Game.Screens.Play
replayLoaded.TriggerChange(); replayLoaded.TriggerChange();
} }
public void BindRulestContainer(RulesetContainer rulesetContainer) public void BindRulestContainer(DrawableRuleset drawableRuleset)
{ {
replayLoaded.BindTo(rulesetContainer.HasReplayLoaded); replayLoaded.BindTo(drawableRuleset.HasReplayLoaded);
} }
private bool allowSeeking; private bool allowSeeking;