1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 23:36:10 +08:00

Naming changes

This commit is contained in:
vun 2022-08-19 15:31:03 +08:00
parent 40b1554fea
commit 5dcd4ce7c5
6 changed files with 62 additions and 62 deletions

View File

@ -26,25 +26,25 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Evaluators
} }
/// <summary> /// <summary>
/// Evaluate the difficulty of the first note of a <see cref="MonoEncoding"/>. /// Evaluate the difficulty of the first note of a <see cref="MonoStreak"/>.
/// </summary> /// </summary>
public static double EvaluateDifficultyOf(MonoEncoding encoding) public static double EvaluateDifficultyOf(MonoStreak encoding)
{ {
return sigmoid(encoding.Index, 2, 2, 0.5, 1) * EvaluateDifficultyOf(encoding.Parent!) * 0.5; return sigmoid(encoding.Index, 2, 2, 0.5, 1) * EvaluateDifficultyOf(encoding.Parent!) * 0.5;
} }
/// <summary> /// <summary>
/// Evaluate the difficulty of the first note of a <see cref="ColourEncoding"/>. /// Evaluate the difficulty of the first note of a <see cref="AlternatingMonoPattern"/>.
/// </summary> /// </summary>
public static double EvaluateDifficultyOf(ColourEncoding encoding) public static double EvaluateDifficultyOf(AlternatingMonoPattern encoding)
{ {
return sigmoid(encoding.Index, 2, 2, 0.5, 1) * EvaluateDifficultyOf(encoding.Parent!); return sigmoid(encoding.Index, 2, 2, 0.5, 1) * EvaluateDifficultyOf(encoding.Parent!);
} }
/// <summary> /// <summary>
/// Evaluate the difficulty of the first note of a <see cref="CoupledColourEncoding"/>. /// Evaluate the difficulty of the first note of a <see cref="RepeatingHitPatterns"/>.
/// </summary> /// </summary>
public static double EvaluateDifficultyOf(CoupledColourEncoding encoding) public static double EvaluateDifficultyOf(RepeatingHitPatterns encoding)
{ {
return 2 * (1 - sigmoid(encoding.RepetitionInterval, 2, 2, 0.5, 1)); return 2 * (1 - sigmoid(encoding.RepetitionInterval, 2, 2, 0.5, 1));
} }

View File

@ -7,20 +7,20 @@ using osu.Game.Rulesets.Taiko.Objects;
namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data
{ {
/// <summary> /// <summary>
/// Encodes a list of <see cref="MonoEncoding"/>s. /// Encodes a list of <see cref="MonoStreak"/>s.
/// <see cref="MonoEncoding"/>s with the same <see cref="MonoEncoding.RunLength"/> are grouped together. /// <see cref="MonoStreak"/>s with the same <see cref="MonoStreak.RunLength"/> are grouped together.
/// </summary> /// </summary>
public class ColourEncoding public class AlternatingMonoPattern
{ {
/// <summary> /// <summary>
/// <see cref="MonoEncoding"/>s that are grouped together within this <see cref="ColourEncoding"/>. /// <see cref="MonoStreak"/>s that are grouped together within this <see cref="AlternatingMonoPattern"/>.
/// </summary> /// </summary>
public readonly List<MonoEncoding> Payload = new List<MonoEncoding>(); public readonly List<MonoStreak> Payload = new List<MonoStreak>();
/// <summary> /// <summary>
/// The parent <see cref="CoupledColourEncoding"/> that contains this <see cref="ColourEncoding"/> /// The parent <see cref="RepeatingHitPatterns"/> that contains this <see cref="AlternatingMonoPattern"/>
/// </summary> /// </summary>
public CoupledColourEncoding? Parent; public RepeatingHitPatterns? Parent;
/// <summary> /// <summary>
/// Index of this encoding within it's parent encoding /// Index of this encoding within it's parent encoding
@ -28,10 +28,10 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data
public int Index; public int Index;
/// <summary> /// <summary>
/// Determine if this <see cref="ColourEncoding"/> is a repetition of another <see cref="ColourEncoding"/>. This /// 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. /// is a strict comparison and is true if and only if the colour sequence is exactly the same.
/// </summary> /// </summary>
public bool IsRepetitionOf(ColourEncoding other) public bool IsRepetitionOf(AlternatingMonoPattern other)
{ {
return HasIdenticalMonoLength(other) && return HasIdenticalMonoLength(other) &&
other.Payload.Count == Payload.Count && other.Payload.Count == Payload.Count &&
@ -40,9 +40,9 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data
} }
/// <summary> /// <summary>
/// Determine if this <see cref="ColourEncoding"/> has the same mono length of another <see cref="ColourEncoding"/>. /// Determine if this <see cref="AlternatingMonoPattern"/> has the same mono length of another <see cref="AlternatingMonoPattern"/>.
/// </summary> /// </summary>
public bool HasIdenticalMonoLength(ColourEncoding other) public bool HasIdenticalMonoLength(AlternatingMonoPattern other)
{ {
return other.Payload[0].RunLength == Payload[0].RunLength; return other.Payload[0].RunLength == Payload[0].RunLength;
} }

View File

@ -9,19 +9,19 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data
{ {
/// <summary> /// <summary>
/// Encode colour information for a sequence of <see cref="TaikoDifficultyHitObject"/>s. Consecutive <see cref="TaikoDifficultyHitObject"/>s /// Encode colour information for a sequence of <see cref="TaikoDifficultyHitObject"/>s. Consecutive <see cref="TaikoDifficultyHitObject"/>s
/// of the same <see cref="HitType"/> are encoded within the same <see cref="MonoEncoding"/>. /// of the same <see cref="HitType"/> are encoded within the same <see cref="MonoStreak"/>.
/// </summary> /// </summary>
public class MonoEncoding public class MonoStreak
{ {
/// <summary> /// <summary>
/// List of <see cref="DifficultyHitObject"/>s that are encoded within this <see cref="MonoEncoding"/>. /// List of <see cref="DifficultyHitObject"/>s that are encoded within this <see cref="MonoStreak"/>.
/// </summary> /// </summary>
public List<TaikoDifficultyHitObject> EncodedData { get; private set; } = new List<TaikoDifficultyHitObject>(); public List<TaikoDifficultyHitObject> EncodedData { get; private set; } = new List<TaikoDifficultyHitObject>();
/// <summary> /// <summary>
/// The parent <see cref="ColourEncoding"/> that contains this <see cref="MonoEncoding"/> /// The parent <see cref="AlternatingMonoPattern"/> that contains this <see cref="MonoStreak"/>
/// </summary> /// </summary>
public ColourEncoding? Parent; public AlternatingMonoPattern? Parent;
/// <summary> /// <summary>
/// Index of this encoding within it's parent encoding /// Index of this encoding within it's parent encoding

View File

@ -7,33 +7,33 @@ using System.Collections.Generic;
namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data
{ {
/// <summary> /// <summary>
/// Encodes a list of <see cref="ColourEncoding"/>s, grouped together by back and forth repetition of the same /// Encodes a list of <see cref="AlternatingMonoPattern"/>s, grouped together by back and forth repetition of the same
/// <see cref="ColourEncoding"/>. Also stores the repetition interval between this and the previous <see cref="CoupledColourEncoding"/>. /// <see cref="AlternatingMonoPattern"/>. Also stores the repetition interval between this and the previous <see cref="RepeatingHitPatterns"/>.
/// </summary> /// </summary>
public class CoupledColourEncoding public class RepeatingHitPatterns
{ {
/// <summary> /// <summary>
/// Maximum amount of <see cref="CoupledColourEncoding"/>s to look back to find a repetition. /// Maximum amount of <see cref="RepeatingHitPatterns"/>s to look back to find a repetition.
/// </summary> /// </summary>
private const int max_repetition_interval = 16; private const int max_repetition_interval = 16;
/// <summary> /// <summary>
/// The <see cref="ColourEncoding"/>s that are grouped together within this <see cref="CoupledColourEncoding"/>. /// The <see cref="AlternatingMonoPattern"/>s that are grouped together within this <see cref="RepeatingHitPatterns"/>.
/// </summary> /// </summary>
public readonly List<ColourEncoding> Payload = new List<ColourEncoding>(); public readonly List<AlternatingMonoPattern> Payload = new List<AlternatingMonoPattern>();
/// <summary> /// <summary>
/// The previous <see cref="CoupledColourEncoding"/>. This is used to determine the repetition interval. /// The previous <see cref="RepeatingHitPatterns"/>. This is used to determine the repetition interval.
/// </summary> /// </summary>
public readonly CoupledColourEncoding? Previous; public readonly RepeatingHitPatterns? Previous;
/// <summary> /// <summary>
/// How many <see cref="CoupledColourEncoding"/> between the current and previous identical <see cref="CoupledColourEncoding"/>. /// How many <see cref="RepeatingHitPatterns"/> between the current and previous identical <see cref="RepeatingHitPatterns"/>.
/// If no repetition is found this will have a value of <see cref="max_repetition_interval"/> + 1. /// If no repetition is found this will have a value of <see cref="max_repetition_interval"/> + 1.
/// </summary> /// </summary>
public int RepetitionInterval { get; private set; } = max_repetition_interval + 1; public int RepetitionInterval { get; private set; } = max_repetition_interval + 1;
public CoupledColourEncoding(CoupledColourEncoding? previous) public RepeatingHitPatterns(RepeatingHitPatterns? previous)
{ {
Previous = previous; Previous = previous;
} }
@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data
/// Returns true if other is considered a repetition of this encoding. This is true if other's first two payloads /// Returns true if other is considered a repetition of this encoding. This is true if other's first two payloads
/// have identical mono lengths. /// have identical mono lengths.
/// </summary> /// </summary>
private bool isRepetitionOf(CoupledColourEncoding other) private bool isRepetitionOf(RepeatingHitPatterns other)
{ {
if (Payload.Count != other.Payload.Count) return false; if (Payload.Count != other.Payload.Count) return false;
@ -55,8 +55,8 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data
} }
/// <summary> /// <summary>
/// Finds the closest previous <see cref="CoupledColourEncoding"/> that has the identical <see cref="Payload"/>. /// Finds the closest previous <see cref="RepeatingHitPatterns"/> that has the identical <see cref="Payload"/>.
/// Interval is defined as the amount of <see cref="CoupledColourEncoding"/> chunks between the current and repeated encoding. /// Interval is defined as the amount of <see cref="RepeatingHitPatterns"/> chunks between the current and repeated encoding.
/// </summary> /// </summary>
public void FindRepetitionInterval() public void FindRepetitionInterval()
{ {
@ -66,7 +66,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data
return; return;
} }
CoupledColourEncoding? other = Previous; RepeatingHitPatterns? other = Previous;
int interval = 1; int interval = 1;
while (interval < max_repetition_interval) while (interval < max_repetition_interval)

View File

@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
/// </summary> /// </summary>
public static void ProcessAndAssign(List<DifficultyHitObject> hitObjects) public static void ProcessAndAssign(List<DifficultyHitObject> hitObjects)
{ {
List<CoupledColourEncoding> encodings = encode(hitObjects); List<RepeatingHitPatterns> encodings = encode(hitObjects);
// Assign indexing and encoding data to all relevant objects. Only the first note of each encoding type is // Assign indexing and encoding data to all relevant objects. Only the first note of each encoding type is
// assigned with the relevant encodings. // assigned with the relevant encodings.
@ -33,14 +33,14 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
// documentation. // documentation.
for (int i = 0; i < coupledEncoding.Payload.Count; ++i) for (int i = 0; i < coupledEncoding.Payload.Count; ++i)
{ {
ColourEncoding colourEncoding = coupledEncoding.Payload[i]; AlternatingMonoPattern colourEncoding = coupledEncoding.Payload[i];
colourEncoding.Parent = coupledEncoding; colourEncoding.Parent = coupledEncoding;
colourEncoding.Index = i; colourEncoding.Index = i;
colourEncoding.Payload[0].EncodedData[0].Colour.ColourEncoding = colourEncoding; colourEncoding.Payload[0].EncodedData[0].Colour.ColourEncoding = colourEncoding;
for (int j = 0; j < colourEncoding.Payload.Count; ++j) for (int j = 0; j < colourEncoding.Payload.Count; ++j)
{ {
MonoEncoding monoEncoding = colourEncoding.Payload[j]; MonoStreak monoEncoding = colourEncoding.Payload[j];
monoEncoding.Parent = colourEncoding; monoEncoding.Parent = colourEncoding;
monoEncoding.Index = j; monoEncoding.Index = j;
monoEncoding.EncodedData[0].Colour.MonoEncoding = monoEncoding; monoEncoding.EncodedData[0].Colour.MonoEncoding = monoEncoding;
@ -50,24 +50,24 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
} }
/// <summary> /// <summary>
/// Encodes a list of <see cref="TaikoDifficultyHitObject"/>s into a list of <see cref="CoupledColourEncoding"/>s. /// Encodes a list of <see cref="TaikoDifficultyHitObject"/>s into a list of <see cref="RepeatingHitPatterns"/>s.
/// </summary> /// </summary>
private static List<CoupledColourEncoding> encode(List<DifficultyHitObject> data) private static List<RepeatingHitPatterns> encode(List<DifficultyHitObject> data)
{ {
List<MonoEncoding> firstPass = encodeMono(data); List<MonoStreak> firstPass = encodeMono(data);
List<ColourEncoding> secondPass = encodeColour(firstPass); List<AlternatingMonoPattern> secondPass = encodeColour(firstPass);
List<CoupledColourEncoding> thirdPass = encodeCoupledColour(secondPass); List<RepeatingHitPatterns> thirdPass = encodeCoupledColour(secondPass);
return thirdPass; return thirdPass;
} }
/// <summary> /// <summary>
/// Encodes a list of <see cref="TaikoDifficultyHitObject"/>s into a list of <see cref="MonoEncoding"/>s. /// Encodes a list of <see cref="TaikoDifficultyHitObject"/>s into a list of <see cref="MonoStreak"/>s.
/// </summary> /// </summary>
private static List<MonoEncoding> encodeMono(List<DifficultyHitObject> data) private static List<MonoStreak> encodeMono(List<DifficultyHitObject> data)
{ {
List<MonoEncoding> encodings = new List<MonoEncoding>(); List<MonoStreak> encodings = new List<MonoStreak>();
MonoEncoding? currentEncoding = null; MonoStreak? currentEncoding = null;
for (int i = 0; i < data.Count; i++) for (int i = 0; i < data.Count; i++)
{ {
@ -79,7 +79,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
// If this is the first object in the list or the colour changed, create a new mono encoding // If this is the first object in the list or the colour changed, create a new mono encoding
if (currentEncoding == null || previousObject == null || (taikoObject.BaseObject as Hit)?.Type != (previousObject.BaseObject as Hit)?.Type) if (currentEncoding == null || previousObject == null || (taikoObject.BaseObject as Hit)?.Type != (previousObject.BaseObject as Hit)?.Type)
{ {
currentEncoding = new MonoEncoding(); currentEncoding = new MonoStreak();
encodings.Add(currentEncoding); encodings.Add(currentEncoding);
} }
@ -91,19 +91,19 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
} }
/// <summary> /// <summary>
/// Encodes a list of <see cref="MonoEncoding"/>s into a list of <see cref="ColourEncoding"/>s. /// Encodes a list of <see cref="MonoStreak"/>s into a list of <see cref="AlternatingMonoPattern"/>s.
/// </summary> /// </summary>
private static List<ColourEncoding> encodeColour(List<MonoEncoding> data) private static List<AlternatingMonoPattern> encodeColour(List<MonoStreak> data)
{ {
List<ColourEncoding> encodings = new List<ColourEncoding>(); List<AlternatingMonoPattern> encodings = new List<AlternatingMonoPattern>();
ColourEncoding? currentEncoding = null; AlternatingMonoPattern? currentEncoding = null;
for (int i = 0; i < data.Count; i++) for (int i = 0; i < data.Count; i++)
{ {
// Start a new ColourEncoding if the previous MonoEncoding has a different mono length, or if this is the first MonoEncoding in the list. // Start a new ColourEncoding if the previous MonoEncoding has a different mono length, or if this is the first MonoEncoding in the list.
if (currentEncoding == null || data[i].RunLength != data[i - 1].RunLength) if (currentEncoding == null || data[i].RunLength != data[i - 1].RunLength)
{ {
currentEncoding = new ColourEncoding(); currentEncoding = new AlternatingMonoPattern();
encodings.Add(currentEncoding); encodings.Add(currentEncoding);
} }
@ -115,17 +115,17 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
} }
/// <summary> /// <summary>
/// Encodes a list of <see cref="ColourEncoding"/>s into a list of <see cref="CoupledColourEncoding"/>s. /// Encodes a list of <see cref="AlternatingMonoPattern"/>s into a list of <see cref="RepeatingHitPatterns"/>s.
/// </summary> /// </summary>
private static List<CoupledColourEncoding> encodeCoupledColour(List<ColourEncoding> data) private static List<RepeatingHitPatterns> encodeCoupledColour(List<AlternatingMonoPattern> data)
{ {
List<CoupledColourEncoding> encodings = new List<CoupledColourEncoding>(); List<RepeatingHitPatterns> encodings = new List<RepeatingHitPatterns>();
CoupledColourEncoding? currentEncoding = null; RepeatingHitPatterns? currentEncoding = null;
for (int i = 0; i < data.Count; i++) for (int i = 0; i < data.Count; i++)
{ {
// Start a new CoupledColourEncoding. ColourEncodings that should be grouped together will be handled later within this loop. // Start a new CoupledColourEncoding. ColourEncodings that should be grouped together will be handled later within this loop.
currentEncoding = new CoupledColourEncoding(currentEncoding); currentEncoding = new RepeatingHitPatterns(currentEncoding);
// Determine if future ColourEncodings should be grouped. // Determine if future ColourEncodings should be grouped.
bool isCoupled = i < data.Count - 2 && data[i].IsRepetitionOf(data[i + 2]); bool isCoupled = i < data.Count - 2 && data[i].IsRepetitionOf(data[i + 2]);

View File

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