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 57da216445..83aa67eb70 100644 --- a/osu.Game/Rulesets/Objects/CurvedHitObject.cs +++ b/osu.Game/Rulesets/Objects/CurvedHitObject.cs @@ -5,7 +5,6 @@ using OpenTK; using osu.Game.Rulesets.Objects.Types; using System.Collections.Generic; using osu.Game.Audio; -using System; namespace osu.Game.Rulesets.Objects { @@ -38,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 2bf0f0d662..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 { @@ -76,7 +75,7 @@ namespace osu.Game.Rulesets.Objects.Legacy if (split.Length > 7) length = Convert.ToDouble(split[7], CultureInfo.InvariantCulture); - + if (split.Length > 10) readCustomSampleBanks(split[10], bankInfo); @@ -108,10 +107,9 @@ namespace osu.Game.Rulesets.Objects.Legacy nodeSoundTypes.Add(soundType); // Read any per-node sound types - string[] adds = null; if (split.Length > 8 && split[8].Length > 0) { - adds = split[8].Split('|'); + string[] adds = split[8].Split('|'); for (int i = 0; i < nodes; i++) { if (i >= adds.Length) @@ -128,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) { @@ -210,10 +201,11 @@ namespace osu.Game.Rulesets.Objects.Legacy /// The slider length. /// The slider curve type. /// The slider repeat count. - /// The slider repeat sounds (this includes the end node, but NOT the start node). + /// The samples to be played when the head of the slider is hit. + /// 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. @@ -225,15 +217,16 @@ namespace osu.Game.Rulesets.Objects.Legacy private List convertSoundType(LegacySoundType type, SampleBankInfo bankInfo) { - var soundTypes = new List(); - - soundTypes.Add(new SampleInfo + var soundTypes = new List { - Bank = bankInfo.Normal, - Name = SampleInfo.HIT_NORMAL, - Volume = bankInfo.Volume - }); - + new SampleInfo + { + Bank = bankInfo.Normal, + Name = SampleInfo.HIT_NORMAL, + Volume = bankInfo.Volume + } + }; + if ((type & LegacySoundType.Finish) > 0) { soundTypes.Add(new SampleInfo @@ -269,9 +262,9 @@ namespace osu.Game.Rulesets.Objects.Legacy private class SampleBankInfo { - public string Normal = null; - public string Add = null; - public int Volume = 0; + public string Normal; + public string Add; + public int Volume; public SampleBankInfo Clone() { 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 40e0b367de..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. ///