Better namings for the speed change "algorithms"

This commit is contained in:
smoogipoo
2018-01-12 17:18:34 +09:00
parent cae93a1d1f
commit 441e8aced5
8 changed files with 31 additions and 31 deletions

View File

@ -9,7 +9,7 @@ using osu.Framework.Lists;
using osu.Game.Configuration;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Timing;
using osu.Game.Rulesets.UI.Scrolling.Algorithms;
using osu.Game.Rulesets.UI.Scrolling.Visualisers;
namespace osu.Game.Rulesets.UI.Scrolling
{
@ -42,18 +42,18 @@ namespace osu.Game.Rulesets.UI.Scrolling
TimeRange.ValueChanged += v => initialStateCache.Invalidate();
}
private IScrollingAlgorithm scrollingAlgorithm;
private ISpeedChangeVisualiser speedChangeVisualiser;
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
switch (config.Get<ScrollingAlgorithmType>(OsuSetting.ScrollingAlgorithm))
switch (config.Get<SpeedChangeVisualisationMethod>(OsuSetting.SpeedChangeVisualisation))
{
case ScrollingAlgorithmType.Global:
scrollingAlgorithm = new GlobalScrollingAlgorithm(ControlPoints);
case SpeedChangeVisualisationMethod.Sequential:
speedChangeVisualiser = new SequentialSpeedChangeVisualiser(ControlPoints);
break;
case ScrollingAlgorithmType.Local:
scrollingAlgorithm = new LocalScrollingAlgorithm(ControlPoints);
case SpeedChangeVisualisationMethod.Overlapping:
speedChangeVisualiser = new OverlappingSpeedChangeVisualiser(ControlPoints);
break;
}
}
@ -101,7 +101,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
if (initialStateCache.IsValid)
return;
scrollingAlgorithm.ComputeInitialStates(Objects, direction, TimeRange, DrawSize);
speedChangeVisualiser.ComputeInitialStates(Objects, direction, TimeRange, DrawSize);
initialStateCache.Validate();
}
@ -111,7 +111,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
base.UpdateAfterChildrenLife();
// We need to calculate this as soon as possible after lifetimes so that hitobjects get the final say in their positions
scrollingAlgorithm.ComputePositions(AliveObjects, direction, Time.Current, TimeRange, DrawSize);
speedChangeVisualiser.ComputePositions(AliveObjects, direction, Time.Current, TimeRange, DrawSize);
}
}
}

View File

@ -5,9 +5,9 @@ using System.Collections.Generic;
using osu.Game.Rulesets.Objects.Drawables;
using OpenTK;
namespace osu.Game.Rulesets.UI.Scrolling.Algorithms
namespace osu.Game.Rulesets.UI.Scrolling.Visualisers
{
public interface IScrollingAlgorithm
public interface ISpeedChangeVisualiser
{
/// <summary>
/// Computes the states of <see cref="DrawableHitObject"/>s that are constant, such as lifetime and spatial length.

View File

@ -7,15 +7,15 @@ using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Timing;
using OpenTK;
namespace osu.Game.Rulesets.UI.Scrolling.Algorithms
namespace osu.Game.Rulesets.UI.Scrolling.Visualisers
{
public class LocalScrollingAlgorithm : IScrollingAlgorithm
public class OverlappingSpeedChangeVisualiser : ISpeedChangeVisualiser
{
private readonly Dictionary<DrawableHitObject, double> hitObjectPositions = new Dictionary<DrawableHitObject, double>();
private readonly SortedList<MultiplierControlPoint> controlPoints;
public LocalScrollingAlgorithm(SortedList<MultiplierControlPoint> controlPoints)
public OverlappingSpeedChangeVisualiser(SortedList<MultiplierControlPoint> controlPoints)
{
this.controlPoints = controlPoints;
}

View File

@ -8,15 +8,15 @@ using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Timing;
using OpenTK;
namespace osu.Game.Rulesets.UI.Scrolling.Algorithms
namespace osu.Game.Rulesets.UI.Scrolling.Visualisers
{
public class GlobalScrollingAlgorithm : IScrollingAlgorithm
public class SequentialSpeedChangeVisualiser : ISpeedChangeVisualiser
{
private readonly Dictionary<DrawableHitObject, double> hitObjectPositions = new Dictionary<DrawableHitObject, double>();
private readonly IReadOnlyList<MultiplierControlPoint> controlPoints;
public GlobalScrollingAlgorithm(IReadOnlyList<MultiplierControlPoint> controlPoints)
public SequentialSpeedChangeVisualiser(IReadOnlyList<MultiplierControlPoint> controlPoints)
{
this.controlPoints = controlPoints;
}