diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs b/osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs index 2e07117734..296a9f9631 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModRelax.cs @@ -24,35 +24,35 @@ namespace osu.Game.Rulesets.Osu.Mods private bool hitStill; private bool hitOnce; - public void Update(DrawableHitObject o) + public void Update(DrawableHitObject drawable) { const float relax_leniency = 3; - if (!(o is DrawableOsuHitObject d)) + if (!(drawable is DrawableOsuHitObject osuHit)) return; - double t = d.Clock.CurrentTime; + double time = osuHit.Clock.CurrentTime; - if (t >= d.HitObject.StartTime - relax_leniency) + if (time >= osuHit.HitObject.StartTime - relax_leniency) { - if (d.HitObject is IHasEndTime e && t > e.EndTime || d.IsHit) + if (osuHit.HitObject is IHasEndTime hasEnd && time > hasEnd.EndTime || osuHit.IsHit) return; - hitStill |= d is DrawableSlider s && (s.Ball.IsHovered || d.IsHovered) || d is DrawableSpinner; + hitStill |= osuHit is DrawableSlider slider && (slider.Ball.IsHovered || osuHit.IsHovered) || osuHit is DrawableSpinner; - hitOnce |= d is DrawableHitCircle && d.IsHovered; + hitOnce |= osuHit is DrawableHitCircle && osuHit.IsHovered; } } - public void Update(Playfield r) + public void Update(Playfield playfield) { - var d = r.HitObjects.Objects.First(h => h is DrawableOsuHitObject) as DrawableOsuHitObject; + var osuHit = playfield.HitObjects.Objects.First(d => d is DrawableOsuHitObject) as DrawableOsuHitObject; if (hitOnce) { - hit(d, false); - hit(d, true); + hit(osuHit, false); + hit(osuHit, true); } - hit(d, hitStill); + hit(osuHit, hitStill); hitOnce = false; hitStill = false; @@ -61,22 +61,22 @@ namespace osu.Game.Rulesets.Osu.Mods private bool wasHit; private bool wasLeft; - private void hit(DrawableOsuHitObject d, bool hitting) + private void hit(DrawableOsuHitObject osuHit, bool hitting) { if (wasHit == hitting) return; wasHit = hitting; - var l = new ReplayState + var state = new ReplayState { PressedActions = new List() }; if (hitting) { - l.PressedActions.Add(wasLeft ? OsuAction.LeftButton : OsuAction.RightButton); + state.PressedActions.Add(wasLeft ? OsuAction.LeftButton : OsuAction.RightButton); wasLeft = !wasLeft; } - d.OsuActionInputManager.HandleCustomInput(new InputState(), l); + osuHit.OsuActionInputManager.HandleCustomInput(new InputState(), state); } } } diff --git a/osu.Game/Rulesets/Mods/IUpdatableByHitObject.cs b/osu.Game/Rulesets/Mods/IUpdatableByHitObject.cs index 657145b911..6dd900e9c5 100644 --- a/osu.Game/Rulesets/Mods/IUpdatableByHitObject.cs +++ b/osu.Game/Rulesets/Mods/IUpdatableByHitObject.cs @@ -7,6 +7,6 @@ namespace osu.Game.Rulesets.Mods { public interface IUpdatableByHitObject : IApplicableMod { - void Update(DrawableHitObject o); + void Update(DrawableHitObject drawable); } } diff --git a/osu.Game/Rulesets/Mods/IUpdatableByPlayfield.cs b/osu.Game/Rulesets/Mods/IUpdatableByPlayfield.cs index 39781a875d..be879759bd 100644 --- a/osu.Game/Rulesets/Mods/IUpdatableByPlayfield.cs +++ b/osu.Game/Rulesets/Mods/IUpdatableByPlayfield.cs @@ -7,6 +7,6 @@ namespace osu.Game.Rulesets.Mods { public interface IUpdatableByPlayfield : IApplicableMod { - void Update(Playfield r); + void Update(Playfield playfield); } } diff --git a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs index 31dd5a4a91..f060f7382c 100644 --- a/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs +++ b/osu.Game/Rulesets/Objects/Drawables/DrawableHitObject.cs @@ -84,9 +84,9 @@ namespace osu.Game.Rulesets.Objects.Drawables } [BackgroundDependencyLoader] - private void load(IBindableBeatmap b) + private void load(IBindableBeatmap bBeatmap) { - beatmap = b.Value; + beatmap = bBeatmap.Value; var samples = GetSamples().ToArray(); if (samples.Any()) @@ -138,9 +138,9 @@ namespace osu.Game.Rulesets.Objects.Drawables base.Update(); if(beatmap != null) - foreach (var m in beatmap.Mods.Value) - if (m is IUpdatableByHitObject u) - u.Update(this); + foreach (var mod in beatmap.Mods.Value) + if (mod is IUpdatableByHitObject updatable) + updatable.Update(this); var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime; diff --git a/osu.Game/Rulesets/UI/Playfield.cs b/osu.Game/Rulesets/UI/Playfield.cs index 7116dc53a9..f7b3736e74 100644 --- a/osu.Game/Rulesets/UI/Playfield.cs +++ b/osu.Game/Rulesets/UI/Playfield.cs @@ -47,9 +47,9 @@ namespace osu.Game.Rulesets.UI private WorkingBeatmap beatmap; [BackgroundDependencyLoader] - private void load(IBindableBeatmap b) + private void load(IBindableBeatmap bBeatmap) { - beatmap = b.Value; + beatmap = bBeatmap.Value; HitObjects = CreateHitObjectContainer(); HitObjects.RelativeSizeAxes = Axes.Both; @@ -98,9 +98,9 @@ namespace osu.Game.Rulesets.UI base.Update(); if (beatmap != null) - foreach (var m in beatmap.Mods.Value) - if (m is IUpdatableByPlayfield u) - u.Update(this); + foreach (var mod in beatmap.Mods.Value) + if (mod is IUpdatableByPlayfield updatable) + updatable.Update(this); } } }