mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 05:32:54 +08:00
Remove HeadSamples and TailSamples, combine into RepeatSamples.
This commit is contained in:
parent
382e656e9f
commit
748f13501a
@ -34,8 +34,6 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
public int RepeatAt(double progress) => CurveObject.RepeatAt(progress);
|
public int RepeatAt(double progress) => CurveObject.RepeatAt(progress);
|
||||||
|
|
||||||
public List<List<SampleInfo>> RepeatSamples => CurveObject.RepeatSamples;
|
public List<List<SampleInfo>> RepeatSamples => CurveObject.RepeatSamples;
|
||||||
public List<SampleInfo> HeadSamples => CurveObject.HeadSamples;
|
|
||||||
public List<SampleInfo> TailSamples => CurveObject.TailSamples;
|
|
||||||
|
|
||||||
public List<Vector2> ControlPoints => CurveObject.ControlPoints;
|
public List<Vector2> ControlPoints => CurveObject.ControlPoints;
|
||||||
public CurveType CurveType => CurveObject.CurveType;
|
public CurveType CurveType => CurveObject.CurveType;
|
||||||
|
@ -37,9 +37,6 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
|
|
||||||
public List<List<SampleInfo>> RepeatSamples { get; set; } = new List<List<SampleInfo>>();
|
public List<List<SampleInfo>> RepeatSamples { get; set; } = new List<List<SampleInfo>>();
|
||||||
|
|
||||||
public List<SampleInfo> HeadSamples { get; set; } = new List<SampleInfo>();
|
|
||||||
public List<SampleInfo> TailSamples { get; set; } = new List<SampleInfo>();
|
|
||||||
|
|
||||||
public Vector2 PositionAt(double progress) => Curve.PositionAt(ProgressAt(progress));
|
public Vector2 PositionAt(double progress) => Curve.PositionAt(ProgressAt(progress));
|
||||||
|
|
||||||
public double ProgressAt(double progress)
|
public double ProgressAt(double progress)
|
||||||
|
@ -49,11 +49,6 @@ namespace osu.Game.Rulesets.Objects
|
|||||||
// Initialize any repeat samples
|
// Initialize any repeat samples
|
||||||
var repeatData = this as IHasRepeats;
|
var repeatData = this as IHasRepeats;
|
||||||
repeatData?.RepeatSamples?.ForEach(r => r.ForEach(s => initializeSampleInfo(s, samplePoint)));
|
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)
|
private void initializeSampleInfo(SampleInfo sample, ControlPoint controlPoint)
|
||||||
|
@ -22,8 +22,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType,
|
protected override HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||||
int repeatCount, List<SampleInfo> headSamples, List<SampleInfo> tailSamples, List<List<SampleInfo>> repeatSamples)
|
|
||||||
{
|
{
|
||||||
return new Slider
|
return new Slider
|
||||||
{
|
{
|
||||||
@ -33,8 +32,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
|||||||
Distance = length,
|
Distance = length,
|
||||||
CurveType = curveType,
|
CurveType = curveType,
|
||||||
RepeatCount = repeatCount,
|
RepeatCount = repeatCount,
|
||||||
HeadSamples = headSamples,
|
|
||||||
TailSamples = tailSamples,
|
|
||||||
RepeatSamples = repeatSamples
|
RepeatSamples = repeatSamples
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,6 @@ using System.Collections.Generic;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using osu.Game.Beatmaps.Formats;
|
using osu.Game.Beatmaps.Formats;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Objects.Legacy
|
namespace osu.Game.Rulesets.Objects.Legacy
|
||||||
{
|
{
|
||||||
@ -127,14 +126,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
|||||||
for (int i = 0; i <= repeatCount; i++)
|
for (int i = 0; i <= repeatCount; i++)
|
||||||
nodeSamples.Add(convertSoundType(nodeSoundTypes[i], nodeBankInfos[i]));
|
nodeSamples.Add(convertSoundType(nodeSoundTypes[i], nodeBankInfos[i]));
|
||||||
|
|
||||||
// Extract the first and last samples for the head and tail respectively
|
result = CreateSlider(new Vector2(int.Parse(split[0]), int.Parse(split[1])), combo, points, length, curveType, repeatCount, nodeSamples);
|
||||||
List<SampleInfo> headSamples = nodeSamples.First();
|
|
||||||
List<SampleInfo> 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);
|
|
||||||
}
|
}
|
||||||
else if ((type & HitObjectType.Spinner) > 0)
|
else if ((type & HitObjectType.Spinner) > 0)
|
||||||
{
|
{
|
||||||
@ -213,8 +205,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
|||||||
/// <param name="tailSamples">The samples to be played when the tail of the slider is hit.</param>
|
/// <param name="tailSamples">The samples to be played when the tail of the slider is hit.</param>
|
||||||
/// <param name="repeatSamples">The samples to be played when the repeat nodes are hit.</param>
|
/// <param name="repeatSamples">The samples to be played when the repeat nodes are hit.</param>
|
||||||
/// <returns>The hit object.</returns>
|
/// <returns>The hit object.</returns>
|
||||||
protected abstract HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType,
|
protected abstract HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples);
|
||||||
int repeatCount, List<SampleInfo> headSamples, List<SampleInfo> tailSamples, List<List<SampleInfo>> repeatSamples);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a legacy Spinner-type hit object.
|
/// Creates a legacy Spinner-type hit object.
|
||||||
|
@ -22,8 +22,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType,
|
protected override HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||||
int repeatCount, List<SampleInfo> headSamples, List<SampleInfo> tailSamples, List<List<SampleInfo>> repeatSamples)
|
|
||||||
{
|
{
|
||||||
return new Slider
|
return new Slider
|
||||||
{
|
{
|
||||||
@ -33,8 +32,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
|||||||
Distance = length,
|
Distance = length,
|
||||||
CurveType = curveType,
|
CurveType = curveType,
|
||||||
RepeatCount = repeatCount,
|
RepeatCount = repeatCount,
|
||||||
HeadSamples = headSamples,
|
|
||||||
TailSamples = tailSamples,
|
|
||||||
RepeatSamples = repeatSamples
|
RepeatSamples = repeatSamples
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType,
|
protected override HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||||
int repeatCount, List<SampleInfo> headSamples, List<SampleInfo> tailSamples, List<List<SampleInfo>> repeatSamples)
|
|
||||||
{
|
{
|
||||||
return new Slider
|
return new Slider
|
||||||
{
|
{
|
||||||
@ -33,8 +32,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
|||||||
Distance = length,
|
Distance = length,
|
||||||
CurveType = curveType,
|
CurveType = curveType,
|
||||||
RepeatCount = repeatCount,
|
RepeatCount = repeatCount,
|
||||||
HeadSamples = headSamples,
|
|
||||||
TailSamples = tailSamples,
|
|
||||||
RepeatSamples = repeatSamples
|
RepeatSamples = repeatSamples
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -21,8 +21,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType,
|
protected override HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||||
int repeatCount, List<SampleInfo> headSamples, List<SampleInfo> tailSamples, List<List<SampleInfo>> repeatSamples)
|
|
||||||
{
|
{
|
||||||
return new Slider
|
return new Slider
|
||||||
{
|
{
|
||||||
@ -31,8 +30,6 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
|||||||
Distance = length,
|
Distance = length,
|
||||||
CurveType = curveType,
|
CurveType = curveType,
|
||||||
RepeatCount = repeatCount,
|
RepeatCount = repeatCount,
|
||||||
HeadSamples = headSamples,
|
|
||||||
TailSamples = tailSamples,
|
|
||||||
RepeatSamples = repeatSamples
|
RepeatSamples = repeatSamples
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Game.Audio;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Objects.Types
|
namespace osu.Game.Rulesets.Objects.Types
|
||||||
{
|
{
|
||||||
@ -27,16 +26,6 @@ namespace osu.Game.Rulesets.Objects.Types
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
CurveType CurveType { get; }
|
CurveType CurveType { get; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The samples to be played when the head of the hit object is hit.
|
|
||||||
/// </summary>
|
|
||||||
List<SampleInfo> HeadSamples { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The samples to be played when the tail of the hit object is hit.
|
|
||||||
/// </summary>
|
|
||||||
List<SampleInfo> TailSamples { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Computes the position on the curve at a given progress, accounting for repeat logic.
|
/// Computes the position on the curve at a given progress, accounting for repeat logic.
|
||||||
/// <para>
|
/// <para>
|
||||||
|
Loading…
Reference in New Issue
Block a user