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

@ -72,7 +72,7 @@ namespace osu.Game.Configuration
Set(OsuSetting.FloatingComments, false); Set(OsuSetting.FloatingComments, false);
Set(OsuSetting.ScrollingAlgorithm, ScrollingAlgorithmType.Global); Set(OsuSetting.SpeedChangeVisualisation, SpeedChangeVisualisationMethod.Sequential);
// Update // Update
Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer); Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer);
@ -119,6 +119,6 @@ namespace osu.Game.Configuration
ChatDisplayHeight, ChatDisplayHeight,
Version, Version,
ShowConvertedBeatmaps, ShowConvertedBeatmaps,
ScrollingAlgorithm SpeedChangeVisualisation
} }
} }

View File

@ -5,11 +5,11 @@ using System.ComponentModel;
namespace osu.Game.Configuration namespace osu.Game.Configuration
{ {
public enum ScrollingAlgorithmType public enum SpeedChangeVisualisationMethod
{ {
[Description("Global")] [Description("Sequential")]
Global, Sequential,
[Description("Local")] [Description("Overlapping")]
Local Overlapping
} }
} }

View File

@ -15,10 +15,10 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
{ {
Children = new[] Children = new[]
{ {
new SettingsEnumDropdown<ScrollingAlgorithmType> new SettingsEnumDropdown<SpeedChangeVisualisationMethod>
{ {
LabelText = "Scrolling algorithm", LabelText = "Visualise speed changes as",
Bindable = config.GetBindable<ScrollingAlgorithmType>(OsuSetting.ScrollingAlgorithm), Bindable = config.GetBindable<SpeedChangeVisualisationMethod>(OsuSetting.SpeedChangeVisualisation),
} }
}; };
} }

View File

@ -9,7 +9,7 @@ using osu.Framework.Lists;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Timing; 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 namespace osu.Game.Rulesets.UI.Scrolling
{ {
@ -42,18 +42,18 @@ namespace osu.Game.Rulesets.UI.Scrolling
TimeRange.ValueChanged += v => initialStateCache.Invalidate(); TimeRange.ValueChanged += v => initialStateCache.Invalidate();
} }
private IScrollingAlgorithm scrollingAlgorithm; private ISpeedChangeVisualiser speedChangeVisualiser;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuConfigManager config) private void load(OsuConfigManager config)
{ {
switch (config.Get<ScrollingAlgorithmType>(OsuSetting.ScrollingAlgorithm)) switch (config.Get<SpeedChangeVisualisationMethod>(OsuSetting.SpeedChangeVisualisation))
{ {
case ScrollingAlgorithmType.Global: case SpeedChangeVisualisationMethod.Sequential:
scrollingAlgorithm = new GlobalScrollingAlgorithm(ControlPoints); speedChangeVisualiser = new SequentialSpeedChangeVisualiser(ControlPoints);
break; break;
case ScrollingAlgorithmType.Local: case SpeedChangeVisualisationMethod.Overlapping:
scrollingAlgorithm = new LocalScrollingAlgorithm(ControlPoints); speedChangeVisualiser = new OverlappingSpeedChangeVisualiser(ControlPoints);
break; break;
} }
} }
@ -101,7 +101,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
if (initialStateCache.IsValid) if (initialStateCache.IsValid)
return; return;
scrollingAlgorithm.ComputeInitialStates(Objects, direction, TimeRange, DrawSize); speedChangeVisualiser.ComputeInitialStates(Objects, direction, TimeRange, DrawSize);
initialStateCache.Validate(); initialStateCache.Validate();
} }
@ -111,7 +111,7 @@ namespace osu.Game.Rulesets.UI.Scrolling
base.UpdateAfterChildrenLife(); base.UpdateAfterChildrenLife();
// We need to calculate this as soon as possible after lifetimes so that hitobjects get the final say in their positions // 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 osu.Game.Rulesets.Objects.Drawables;
using OpenTK; using OpenTK;
namespace osu.Game.Rulesets.UI.Scrolling.Algorithms namespace osu.Game.Rulesets.UI.Scrolling.Visualisers
{ {
public interface IScrollingAlgorithm public interface ISpeedChangeVisualiser
{ {
/// <summary> /// <summary>
/// Computes the states of <see cref="DrawableHitObject"/>s that are constant, such as lifetime and spatial length. /// 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 osu.Game.Rulesets.Timing;
using OpenTK; 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 Dictionary<DrawableHitObject, double> hitObjectPositions = new Dictionary<DrawableHitObject, double>();
private readonly SortedList<MultiplierControlPoint> controlPoints; private readonly SortedList<MultiplierControlPoint> controlPoints;
public LocalScrollingAlgorithm(SortedList<MultiplierControlPoint> controlPoints) public OverlappingSpeedChangeVisualiser(SortedList<MultiplierControlPoint> controlPoints)
{ {
this.controlPoints = controlPoints; this.controlPoints = controlPoints;
} }

View File

@ -8,15 +8,15 @@ using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Timing; using osu.Game.Rulesets.Timing;
using OpenTK; 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 Dictionary<DrawableHitObject, double> hitObjectPositions = new Dictionary<DrawableHitObject, double>();
private readonly IReadOnlyList<MultiplierControlPoint> controlPoints; private readonly IReadOnlyList<MultiplierControlPoint> controlPoints;
public GlobalScrollingAlgorithm(IReadOnlyList<MultiplierControlPoint> controlPoints) public SequentialSpeedChangeVisualiser(IReadOnlyList<MultiplierControlPoint> controlPoints)
{ {
this.controlPoints = controlPoints; this.controlPoints = controlPoints;
} }

View File

@ -265,7 +265,7 @@
<Compile Include="Beatmaps\Formats\JsonBeatmapDecoder.cs" /> <Compile Include="Beatmaps\Formats\JsonBeatmapDecoder.cs" />
<Compile Include="Beatmaps\Formats\LegacyDecoder.cs" /> <Compile Include="Beatmaps\Formats\LegacyDecoder.cs" />
<Compile Include="Beatmaps\Formats\LegacyStoryboardDecoder.cs" /> <Compile Include="Beatmaps\Formats\LegacyStoryboardDecoder.cs" />
<Compile Include="Configuration\ScrollingAlgorithmType.cs" /> <Compile Include="Configuration\SpeedChangeVisualisationMethod.cs" />
<Compile Include="Database\DatabaseContextFactory.cs" /> <Compile Include="Database\DatabaseContextFactory.cs" />
<Compile Include="Database\IHasPrimaryKey.cs" /> <Compile Include="Database\IHasPrimaryKey.cs" />
<Compile Include="Graphics\Textures\LargeTextureStore.cs" /> <Compile Include="Graphics\Textures\LargeTextureStore.cs" />
@ -318,9 +318,9 @@
<Compile Include="Rulesets\Mods\IApplicableToBeatmapConverter.cs" /> <Compile Include="Rulesets\Mods\IApplicableToBeatmapConverter.cs" />
<Compile Include="Rulesets\Mods\IApplicableToDrawableHitObject.cs" /> <Compile Include="Rulesets\Mods\IApplicableToDrawableHitObject.cs" />
<Compile Include="Rulesets\UI\HitObjectContainer.cs" /> <Compile Include="Rulesets\UI\HitObjectContainer.cs" />
<Compile Include="Rulesets\UI\Scrolling\Algorithms\GlobalScrollingAlgorithm.cs" /> <Compile Include="Rulesets\UI\Scrolling\Algorithms\SequentialSpeedChangeVisualiser.cs" />
<Compile Include="Rulesets\UI\Scrolling\Algorithms\IScrollingAlgorithm.cs" /> <Compile Include="Rulesets\UI\Scrolling\Algorithms\ISpeedChangeVisualiser.cs" />
<Compile Include="Rulesets\UI\Scrolling\Algorithms\LocalScrollingAlgorithm.cs" /> <Compile Include="Rulesets\UI\Scrolling\Algorithms\OverlappingSpeedChangeVisualiser.cs" />
<Compile Include="Rulesets\UI\Scrolling\ScrollingDirection.cs" /> <Compile Include="Rulesets\UI\Scrolling\ScrollingDirection.cs" />
<Compile Include="Rulesets\UI\Scrolling\ScrollingHitObjectContainer.cs" /> <Compile Include="Rulesets\UI\Scrolling\ScrollingHitObjectContainer.cs" />
<Compile Include="Rulesets\UI\Scrolling\ScrollingPlayfield.cs" /> <Compile Include="Rulesets\UI\Scrolling\ScrollingPlayfield.cs" />