diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index a5749408af..2d2fba0ad5 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -48,13 +48,13 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables } [BackgroundDependencyLoader(true)] - private void load(ManiaRulesetConfigManager rulesetConfig, SnapFinder snapFinder) + private void load(ManiaRulesetConfigManager rulesetConfig, BeatDivisorFinder beatDivisorFinder) { - if (snapFinder != null) + if (beatDivisorFinder != null) { rulesetConfig?.BindWith(ManiaRulesetSetting.ColourCodedNotes, configColourCodedNotes); - HitObject.StartTimeBindable.BindValueChanged(_ => snap.Value = snapFinder.FindSnap(HitObject), true); + HitObject.StartTimeBindable.BindValueChanged(_ => snap.Value = beatDivisorFinder.FindDivisor(HitObject), true); snap.BindValueChanged(_ => updateSnapColour(), true); configColourCodedNotes.BindValueChanged(_ => updateSnapColour()); diff --git a/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs b/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs index 174727cc2d..0177c01240 100644 --- a/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs @@ -46,7 +46,7 @@ namespace osu.Game.Rulesets.Mania.UI public new ManiaBeatmap Beatmap => (ManiaBeatmap)base.Beatmap; [Cached] - private SnapFinder snapFinder { get; set; } + private BeatDivisorFinder beatDivisorFinder { get; set; } public IEnumerable BarLines; @@ -80,7 +80,7 @@ namespace osu.Game.Rulesets.Mania.UI : base(ruleset, beatmap, mods) { BarLines = new BarLineGenerator(Beatmap).BarLines; - snapFinder = new SnapFinder(Beatmap); + beatDivisorFinder = new BeatDivisorFinder(Beatmap); } [BackgroundDependencyLoader] diff --git a/osu.Game/Rulesets/Objects/SnapFinder.cs b/osu.Game/Rulesets/Objects/BeatDivisorFinder.cs similarity index 77% rename from osu.Game/Rulesets/Objects/SnapFinder.cs rename to osu.Game/Rulesets/Objects/BeatDivisorFinder.cs index 3bc1d5cfb7..29b271a7e7 100644 --- a/osu.Game/Rulesets/Objects/SnapFinder.cs +++ b/osu.Game/Rulesets/Objects/BeatDivisorFinder.cs @@ -9,17 +9,17 @@ using osu.Game.Beatmaps.ControlPoints; namespace osu.Game.Rulesets.Objects { /// - /// Used to find the lowest beat divisor that a aligns to in an + /// Used to find the lowest beat divisor that a aligns to in an . /// - public class SnapFinder + public class BeatDivisorFinder { private readonly IBeatmap beatmap; /// - /// Creates a new SnapFinder instance. + /// Creates a new instance. /// - /// The beatmap to align to when evaulating. - public SnapFinder(IBeatmap beatmap) + /// The beatmap to use when calculating beat divisor alignment. + public BeatDivisorFinder(IBeatmap beatmap) { this.beatmap = beatmap; } @@ -27,10 +27,10 @@ namespace osu.Game.Rulesets.Objects private static readonly int[] snaps = { 1, 2, 3, 4, 6, 8, 12, 16 }; /// - /// Finds the lowest beat divisor that the given HitObject aligns to. + /// Finds the lowest beat divisor that the given aligns to. /// /// The to evaluate. - public int FindSnap(HitObject hitObject) + public int FindDivisor(HitObject hitObject) { TimingControlPoint currentTimingPoint = beatmap.ControlPointInfo.TimingPointAt(hitObject.StartTime); double snapResult = (hitObject.StartTime - currentTimingPoint.Time) % (currentTimingPoint.BeatLength * 4);