From 748f13501a334aed831e0688013b86cb2db7f49c Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Fri, 21 Apr 2017 20:04:40 +0900 Subject: [PATCH] Remove HeadSamples and TailSamples, combine into RepeatSamples. --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 2 -- osu.Game/Rulesets/Objects/CurvedHitObject.cs | 3 --- osu.Game/Rulesets/Objects/HitObject.cs | 5 ----- .../Objects/Legacy/Catch/HitObjectParser.cs | 5 +---- osu.Game/Rulesets/Objects/Legacy/HitObjectParser.cs | 13 ++----------- .../Objects/Legacy/Mania/HitObjectParser.cs | 5 +---- .../Rulesets/Objects/Legacy/Osu/HitObjectParser.cs | 5 +---- .../Objects/Legacy/Taiko/HitObjectParser.cs | 5 +---- osu.Game/Rulesets/Objects/Types/IHasCurve.cs | 11 ----------- 9 files changed, 6 insertions(+), 48 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 075d03d247..48c871d64d 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -34,8 +34,6 @@ namespace osu.Game.Rulesets.Osu.Objects public int RepeatAt(double progress) => CurveObject.RepeatAt(progress); public List> RepeatSamples => CurveObject.RepeatSamples; - public List HeadSamples => CurveObject.HeadSamples; - public List TailSamples => CurveObject.TailSamples; public List ControlPoints => CurveObject.ControlPoints; public CurveType CurveType => CurveObject.CurveType; diff --git a/osu.Game/Rulesets/Objects/CurvedHitObject.cs b/osu.Game/Rulesets/Objects/CurvedHitObject.cs index 4d1d437e8a..83aa67eb70 100644 --- a/osu.Game/Rulesets/Objects/CurvedHitObject.cs +++ b/osu.Game/Rulesets/Objects/CurvedHitObject.cs @@ -37,9 +37,6 @@ namespace osu.Game.Rulesets.Objects public List> RepeatSamples { get; set; } = new List>(); - public List HeadSamples { get; set; } = new List(); - public List TailSamples { get; set; } = new List(); - public Vector2 PositionAt(double progress) => Curve.PositionAt(ProgressAt(progress)); public double ProgressAt(double progress) diff --git a/osu.Game/Rulesets/Objects/HitObject.cs b/osu.Game/Rulesets/Objects/HitObject.cs index fe53a6ad7f..4ebe7137c4 100644 --- a/osu.Game/Rulesets/Objects/HitObject.cs +++ b/osu.Game/Rulesets/Objects/HitObject.cs @@ -49,11 +49,6 @@ namespace osu.Game.Rulesets.Objects // Initialize any repeat samples var repeatData = this as IHasRepeats; repeatData?.RepeatSamples?.ForEach(r => r.ForEach(s => initializeSampleInfo(s, samplePoint))); - - // Initialize any curved object samples - var curvedObject = this as CurvedHitObject; - curvedObject?.HeadSamples.ForEach(s => initializeSampleInfo(s, samplePoint)); - curvedObject?.TailSamples.ForEach(s => initializeSampleInfo(s, samplePoint)); } private void initializeSampleInfo(SampleInfo sample, ControlPoint controlPoint) diff --git a/osu.Game/Rulesets/Objects/Legacy/Catch/HitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Catch/HitObjectParser.cs index 5e8c096da0..7ce6af85fd 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Catch/HitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Catch/HitObjectParser.cs @@ -22,8 +22,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch }; } - protected override HitObject CreateSlider(Vector2 position, bool newCombo, List controlPoints, double length, CurveType curveType, - int repeatCount, List headSamples, List tailSamples, List> repeatSamples) + protected override HitObject CreateSlider(Vector2 position, bool newCombo, List controlPoints, double length, CurveType curveType, int repeatCount, List> repeatSamples) { return new Slider { @@ -33,8 +32,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch Distance = length, CurveType = curveType, RepeatCount = repeatCount, - HeadSamples = headSamples, - TailSamples = tailSamples, RepeatSamples = repeatSamples }; } diff --git a/osu.Game/Rulesets/Objects/Legacy/HitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/HitObjectParser.cs index 124f31cbc1..1078efdab1 100644 --- a/osu.Game/Rulesets/Objects/Legacy/HitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/HitObjectParser.cs @@ -8,7 +8,6 @@ using System.Collections.Generic; using System.Globalization; using osu.Game.Beatmaps.Formats; using osu.Game.Audio; -using System.Linq; namespace osu.Game.Rulesets.Objects.Legacy { @@ -127,14 +126,7 @@ namespace osu.Game.Rulesets.Objects.Legacy for (int i = 0; i <= repeatCount; i++) nodeSamples.Add(convertSoundType(nodeSoundTypes[i], nodeBankInfos[i])); - // Extract the first and last samples for the head and tail respectively - List headSamples = nodeSamples.First(); - List tailSamples = nodeSamples.Last(); - - // Repeat samples are all the samples between head and tail - var repeatSamples = nodeSamples.Skip(1).TakeWhile(s => s != tailSamples).ToList(); - - result = CreateSlider(new Vector2(int.Parse(split[0]), int.Parse(split[1])), combo, points, length, curveType, repeatCount, headSamples, tailSamples, repeatSamples); + result = CreateSlider(new Vector2(int.Parse(split[0]), int.Parse(split[1])), combo, points, length, curveType, repeatCount, nodeSamples); } else if ((type & HitObjectType.Spinner) > 0) { @@ -213,8 +205,7 @@ namespace osu.Game.Rulesets.Objects.Legacy /// The samples to be played when the tail of the slider is hit. /// The samples to be played when the repeat nodes are hit. /// The hit object. - protected abstract HitObject CreateSlider(Vector2 position, bool newCombo, List controlPoints, double length, CurveType curveType, - int repeatCount, List headSamples, List tailSamples, List> repeatSamples); + protected abstract HitObject CreateSlider(Vector2 position, bool newCombo, List controlPoints, double length, CurveType curveType, int repeatCount, List> repeatSamples); /// /// Creates a legacy Spinner-type hit object. diff --git a/osu.Game/Rulesets/Objects/Legacy/Mania/HitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Mania/HitObjectParser.cs index fa75592f74..f3b0738b1a 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Mania/HitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Mania/HitObjectParser.cs @@ -22,8 +22,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania }; } - protected override HitObject CreateSlider(Vector2 position, bool newCombo, List controlPoints, double length, CurveType curveType, - int repeatCount, List headSamples, List tailSamples, List> repeatSamples) + protected override HitObject CreateSlider(Vector2 position, bool newCombo, List controlPoints, double length, CurveType curveType, int repeatCount, List> repeatSamples) { return new Slider { @@ -33,8 +32,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania Distance = length, CurveType = curveType, RepeatCount = repeatCount, - HeadSamples = headSamples, - TailSamples = tailSamples, RepeatSamples = repeatSamples }; } diff --git a/osu.Game/Rulesets/Objects/Legacy/Osu/HitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Osu/HitObjectParser.cs index f8310b9075..fd018c41a2 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Osu/HitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Osu/HitObjectParser.cs @@ -22,8 +22,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu }; } - protected override HitObject CreateSlider(Vector2 position, bool newCombo, List controlPoints, double length, CurveType curveType, - int repeatCount, List headSamples, List tailSamples, List> repeatSamples) + protected override HitObject CreateSlider(Vector2 position, bool newCombo, List controlPoints, double length, CurveType curveType, int repeatCount, List> repeatSamples) { return new Slider { @@ -33,8 +32,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu Distance = length, CurveType = curveType, RepeatCount = repeatCount, - HeadSamples = headSamples, - TailSamples = tailSamples, RepeatSamples = repeatSamples }; } diff --git a/osu.Game/Rulesets/Objects/Legacy/Taiko/HitObjectParser.cs b/osu.Game/Rulesets/Objects/Legacy/Taiko/HitObjectParser.cs index 77a29d9883..a297bc5692 100644 --- a/osu.Game/Rulesets/Objects/Legacy/Taiko/HitObjectParser.cs +++ b/osu.Game/Rulesets/Objects/Legacy/Taiko/HitObjectParser.cs @@ -21,8 +21,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko }; } - protected override HitObject CreateSlider(Vector2 position, bool newCombo, List controlPoints, double length, CurveType curveType, - int repeatCount, List headSamples, List tailSamples, List> repeatSamples) + protected override HitObject CreateSlider(Vector2 position, bool newCombo, List controlPoints, double length, CurveType curveType, int repeatCount, List> repeatSamples) { return new Slider { @@ -31,8 +30,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko Distance = length, CurveType = curveType, RepeatCount = repeatCount, - HeadSamples = headSamples, - TailSamples = tailSamples, RepeatSamples = repeatSamples }; } diff --git a/osu.Game/Rulesets/Objects/Types/IHasCurve.cs b/osu.Game/Rulesets/Objects/Types/IHasCurve.cs index cbe59422fb..5ff6d03f6d 100644 --- a/osu.Game/Rulesets/Objects/Types/IHasCurve.cs +++ b/osu.Game/Rulesets/Objects/Types/IHasCurve.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using OpenTK; -using osu.Game.Audio; namespace osu.Game.Rulesets.Objects.Types { @@ -27,16 +26,6 @@ namespace osu.Game.Rulesets.Objects.Types /// CurveType CurveType { get; } - /// - /// The samples to be played when the head of the hit object is hit. - /// - List HeadSamples { get; } - - /// - /// The samples to be played when the tail of the hit object is hit. - /// - List TailSamples { get; } - /// /// Computes the position on the curve at a given progress, accounting for repeat logic. ///