1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 23:12:56 +08:00

Add FirstHitObject as a property of encoding classes

This commit is contained in:
vun 2022-08-19 16:13:36 +08:00
parent a26de0a10f
commit 684efefb50
6 changed files with 25 additions and 7 deletions

View File

@ -58,8 +58,8 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Evaluators
difficulty += EvaluateDifficultyOf(colour.MonoStreak);
if (colour.AlternatingMonoPattern != null) // Difficulty for AlternatingMonoPattern
difficulty += EvaluateDifficultyOf(colour.AlternatingMonoPattern);
if (colour.RepeatingHitPatterns != null) // Difficulty for RepeatingHitPattern
difficulty += EvaluateDifficultyOf(colour.RepeatingHitPatterns);
if (colour.RepeatingHitPattern != null) // Difficulty for RepeatingHitPattern
difficulty += EvaluateDifficultyOf(colour.RepeatingHitPattern);
return difficulty;
}

View File

@ -27,6 +27,11 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data
/// </summary>
public int Index;
/// <summary>
/// The first <see cref="TaikoDifficultyHitObject"/> in this <see cref="AlternatingMonoPattern"/>.
/// </summary>
public TaikoDifficultyHitObject FirstHitObject => MonoStreaks[0].FirstHitObject;
/// <summary>
/// Determine if this <see cref="AlternatingMonoPattern"/> is a repetition of another <see cref="AlternatingMonoPattern"/>. This
/// is a strict comparison and is true if and only if the colour sequence is exactly the same.

View File

@ -28,6 +28,14 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data
/// </summary>
public int Index;
/// <summary>
/// The first <see cref="TaikoDifficultyHitObject"/> in this <see cref="MonoStreak"/>.
/// </summary>
public TaikoDifficultyHitObject FirstHitObject => HitObjects[0];
/// <summary>
/// The hit type of all objects encoded within this <see cref="MonoStreak"/>
/// </summary>
public HitType? HitType => (HitObjects[0].BaseObject as Hit)?.Type;
/// <summary>

View File

@ -22,6 +22,11 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data
/// </summary>
public readonly List<AlternatingMonoPattern> AlternatingMonoPatterns = new List<AlternatingMonoPattern>();
/// <summary>
/// The parent <see cref="TaikoDifficultyHitObject"/> in this <see cref="RepeatingHitPatterns"/>
/// </summary>
public TaikoDifficultyHitObject FirstHitObject => AlternatingMonoPatterns[0].FirstHitObject;
/// <summary>
/// The previous <see cref="RepeatingHitPatterns"/>. This is used to determine the repetition interval.
/// </summary>

View File

@ -26,7 +26,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
// assigned with the relevant encodings.
foreach (var repeatingHitPattern in hitPatterns)
{
repeatingHitPattern.AlternatingMonoPatterns[0].MonoStreaks[0].HitObjects[0].Colour.RepeatingHitPatterns = repeatingHitPattern;
repeatingHitPattern.FirstHitObject.Colour.RepeatingHitPattern = repeatingHitPattern;
// The outermost loop is kept a ForEach loop since it doesn't need index information, and we want to
// keep i and j for AlternatingMonoPattern's and MonoStreak's index respectively, to keep it in line with
@ -36,14 +36,14 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
AlternatingMonoPattern monoPattern = repeatingHitPattern.AlternatingMonoPatterns[i];
monoPattern.Parent = repeatingHitPattern;
monoPattern.Index = i;
monoPattern.MonoStreaks[0].HitObjects[0].Colour.AlternatingMonoPattern = monoPattern;
monoPattern.FirstHitObject.Colour.AlternatingMonoPattern = monoPattern;
for (int j = 0; j < monoPattern.MonoStreaks.Count; ++j)
{
MonoStreak monoStreak = monoPattern.MonoStreaks[j];
monoStreak.Parent = monoPattern;
monoStreak.Index = j;
monoStreak.HitObjects[0].Colour.MonoStreak = monoStreak;
monoStreak.FirstHitObject.Colour.MonoStreak = monoStreak;
}
}
}

View File

@ -21,8 +21,8 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
public AlternatingMonoPattern? AlternatingMonoPattern;
/// <summary>
/// The <see cref="RepeatingHitPatterns"/> that encodes this note, only present if this is the first note within a <see cref="RepeatingHitPatterns"/>
/// The <see cref="RepeatingHitPattern"/> that encodes this note, only present if this is the first note within a <see cref="RepeatingHitPattern"/>
/// </summary>
public RepeatingHitPatterns? RepeatingHitPatterns;
public RepeatingHitPatterns? RepeatingHitPattern;
}
}