mirror of
https://github.com/ppy/osu.git
synced 2025-02-20 20:33:21 +08:00
Naming changes
This commit is contained in:
parent
40b1554fea
commit
5dcd4ce7c5
@ -26,25 +26,25 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Evaluators
|
||||
}
|
||||
|
||||
/// <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>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <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>
|
||||
public static double EvaluateDifficultyOf(ColourEncoding encoding)
|
||||
public static double EvaluateDifficultyOf(AlternatingMonoPattern encoding)
|
||||
{
|
||||
return sigmoid(encoding.Index, 2, 2, 0.5, 1) * EvaluateDifficultyOf(encoding.Parent!);
|
||||
}
|
||||
|
||||
/// <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>
|
||||
public static double EvaluateDifficultyOf(CoupledColourEncoding encoding)
|
||||
public static double EvaluateDifficultyOf(RepeatingHitPatterns encoding)
|
||||
{
|
||||
return 2 * (1 - sigmoid(encoding.RepetitionInterval, 2, 2, 0.5, 1));
|
||||
}
|
||||
|
@ -7,20 +7,20 @@ using osu.Game.Rulesets.Taiko.Objects;
|
||||
namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Encodes a list of <see cref="MonoEncoding"/>s.
|
||||
/// <see cref="MonoEncoding"/>s with the same <see cref="MonoEncoding.RunLength"/> are grouped together.
|
||||
/// Encodes a list of <see cref="MonoStreak"/>s.
|
||||
/// <see cref="MonoStreak"/>s with the same <see cref="MonoStreak.RunLength"/> are grouped together.
|
||||
/// </summary>
|
||||
public class ColourEncoding
|
||||
public class AlternatingMonoPattern
|
||||
{
|
||||
/// <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>
|
||||
public readonly List<MonoEncoding> Payload = new List<MonoEncoding>();
|
||||
public readonly List<MonoStreak> Payload = new List<MonoStreak>();
|
||||
|
||||
/// <summary>
|
||||
/// The parent <see cref="CoupledColourEncoding"/> that contains this <see cref="ColourEncoding"/>
|
||||
/// The parent <see cref="RepeatingHitPatterns"/> that contains this <see cref="AlternatingMonoPattern"/>
|
||||
/// </summary>
|
||||
public CoupledColourEncoding? Parent;
|
||||
public RepeatingHitPatterns? Parent;
|
||||
|
||||
/// <summary>
|
||||
/// 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;
|
||||
|
||||
/// <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.
|
||||
/// </summary>
|
||||
public bool IsRepetitionOf(ColourEncoding other)
|
||||
public bool IsRepetitionOf(AlternatingMonoPattern other)
|
||||
{
|
||||
return HasIdenticalMonoLength(other) &&
|
||||
other.Payload.Count == Payload.Count &&
|
||||
@ -40,9 +40,9 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data
|
||||
}
|
||||
|
||||
/// <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>
|
||||
public bool HasIdenticalMonoLength(ColourEncoding other)
|
||||
public bool HasIdenticalMonoLength(AlternatingMonoPattern other)
|
||||
{
|
||||
return other.Payload[0].RunLength == Payload[0].RunLength;
|
||||
}
|
@ -9,19 +9,19 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// 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>
|
||||
public class MonoEncoding
|
||||
public class MonoStreak
|
||||
{
|
||||
/// <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>
|
||||
public List<TaikoDifficultyHitObject> EncodedData { get; private set; } = new List<TaikoDifficultyHitObject>();
|
||||
|
||||
/// <summary>
|
||||
/// The parent <see cref="ColourEncoding"/> that contains this <see cref="MonoEncoding"/>
|
||||
/// The parent <see cref="AlternatingMonoPattern"/> that contains this <see cref="MonoStreak"/>
|
||||
/// </summary>
|
||||
public ColourEncoding? Parent;
|
||||
public AlternatingMonoPattern? Parent;
|
||||
|
||||
/// <summary>
|
||||
/// Index of this encoding within it's parent encoding
|
@ -7,33 +7,33 @@ using System.Collections.Generic;
|
||||
namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Encodes a list of <see cref="ColourEncoding"/>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"/>.
|
||||
/// Encodes a list of <see cref="AlternatingMonoPattern"/>s, grouped together by back and forth repetition of the same
|
||||
/// <see cref="AlternatingMonoPattern"/>. Also stores the repetition interval between this and the previous <see cref="RepeatingHitPatterns"/>.
|
||||
/// </summary>
|
||||
public class CoupledColourEncoding
|
||||
public class RepeatingHitPatterns
|
||||
{
|
||||
/// <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>
|
||||
private const int max_repetition_interval = 16;
|
||||
|
||||
/// <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>
|
||||
public readonly List<ColourEncoding> Payload = new List<ColourEncoding>();
|
||||
public readonly List<AlternatingMonoPattern> Payload = new List<AlternatingMonoPattern>();
|
||||
|
||||
/// <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>
|
||||
public readonly CoupledColourEncoding? Previous;
|
||||
public readonly RepeatingHitPatterns? Previous;
|
||||
|
||||
/// <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.
|
||||
/// </summary>
|
||||
public int RepetitionInterval { get; private set; } = max_repetition_interval + 1;
|
||||
|
||||
public CoupledColourEncoding(CoupledColourEncoding? previous)
|
||||
public RepeatingHitPatterns(RepeatingHitPatterns? 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
|
||||
/// have identical mono lengths.
|
||||
/// </summary>
|
||||
private bool isRepetitionOf(CoupledColourEncoding other)
|
||||
private bool isRepetitionOf(RepeatingHitPatterns other)
|
||||
{
|
||||
if (Payload.Count != other.Payload.Count) return false;
|
||||
|
||||
@ -55,8 +55,8 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds the closest previous <see cref="CoupledColourEncoding"/> that has the identical <see cref="Payload"/>.
|
||||
/// Interval is defined as the amount of <see cref="CoupledColourEncoding"/> chunks between the current and repeated encoding.
|
||||
/// Finds the closest previous <see cref="RepeatingHitPatterns"/> that has the identical <see cref="Payload"/>.
|
||||
/// Interval is defined as the amount of <see cref="RepeatingHitPatterns"/> chunks between the current and repeated encoding.
|
||||
/// </summary>
|
||||
public void FindRepetitionInterval()
|
||||
{
|
||||
@ -66,7 +66,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour.Data
|
||||
return;
|
||||
}
|
||||
|
||||
CoupledColourEncoding? other = Previous;
|
||||
RepeatingHitPatterns? other = Previous;
|
||||
int interval = 1;
|
||||
|
||||
while (interval < max_repetition_interval)
|
@ -20,7 +20,7 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
|
||||
/// </summary>
|
||||
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
|
||||
// assigned with the relevant encodings.
|
||||
@ -33,14 +33,14 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
|
||||
// documentation.
|
||||
for (int i = 0; i < coupledEncoding.Payload.Count; ++i)
|
||||
{
|
||||
ColourEncoding colourEncoding = coupledEncoding.Payload[i];
|
||||
AlternatingMonoPattern colourEncoding = coupledEncoding.Payload[i];
|
||||
colourEncoding.Parent = coupledEncoding;
|
||||
colourEncoding.Index = i;
|
||||
colourEncoding.Payload[0].EncodedData[0].Colour.ColourEncoding = colourEncoding;
|
||||
|
||||
for (int j = 0; j < colourEncoding.Payload.Count; ++j)
|
||||
{
|
||||
MonoEncoding monoEncoding = colourEncoding.Payload[j];
|
||||
MonoStreak monoEncoding = colourEncoding.Payload[j];
|
||||
monoEncoding.Parent = colourEncoding;
|
||||
monoEncoding.Index = j;
|
||||
monoEncoding.EncodedData[0].Colour.MonoEncoding = monoEncoding;
|
||||
@ -50,24 +50,24 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
|
||||
}
|
||||
|
||||
/// <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>
|
||||
private static List<CoupledColourEncoding> encode(List<DifficultyHitObject> data)
|
||||
private static List<RepeatingHitPatterns> encode(List<DifficultyHitObject> data)
|
||||
{
|
||||
List<MonoEncoding> firstPass = encodeMono(data);
|
||||
List<ColourEncoding> secondPass = encodeColour(firstPass);
|
||||
List<CoupledColourEncoding> thirdPass = encodeCoupledColour(secondPass);
|
||||
List<MonoStreak> firstPass = encodeMono(data);
|
||||
List<AlternatingMonoPattern> secondPass = encodeColour(firstPass);
|
||||
List<RepeatingHitPatterns> thirdPass = encodeCoupledColour(secondPass);
|
||||
|
||||
return thirdPass;
|
||||
}
|
||||
|
||||
/// <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>
|
||||
private static List<MonoEncoding> encodeMono(List<DifficultyHitObject> data)
|
||||
private static List<MonoStreak> encodeMono(List<DifficultyHitObject> data)
|
||||
{
|
||||
List<MonoEncoding> encodings = new List<MonoEncoding>();
|
||||
MonoEncoding? currentEncoding = null;
|
||||
List<MonoStreak> encodings = new List<MonoStreak>();
|
||||
MonoStreak? currentEncoding = null;
|
||||
|
||||
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 (currentEncoding == null || previousObject == null || (taikoObject.BaseObject as Hit)?.Type != (previousObject.BaseObject as Hit)?.Type)
|
||||
{
|
||||
currentEncoding = new MonoEncoding();
|
||||
currentEncoding = new MonoStreak();
|
||||
encodings.Add(currentEncoding);
|
||||
}
|
||||
|
||||
@ -91,19 +91,19 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
|
||||
}
|
||||
|
||||
/// <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>
|
||||
private static List<ColourEncoding> encodeColour(List<MonoEncoding> data)
|
||||
private static List<AlternatingMonoPattern> encodeColour(List<MonoStreak> data)
|
||||
{
|
||||
List<ColourEncoding> encodings = new List<ColourEncoding>();
|
||||
ColourEncoding? currentEncoding = null;
|
||||
List<AlternatingMonoPattern> encodings = new List<AlternatingMonoPattern>();
|
||||
AlternatingMonoPattern? currentEncoding = null;
|
||||
|
||||
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.
|
||||
if (currentEncoding == null || data[i].RunLength != data[i - 1].RunLength)
|
||||
{
|
||||
currentEncoding = new ColourEncoding();
|
||||
currentEncoding = new AlternatingMonoPattern();
|
||||
encodings.Add(currentEncoding);
|
||||
}
|
||||
|
||||
@ -115,17 +115,17 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
|
||||
}
|
||||
|
||||
/// <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>
|
||||
private static List<CoupledColourEncoding> encodeCoupledColour(List<ColourEncoding> data)
|
||||
private static List<RepeatingHitPatterns> encodeCoupledColour(List<AlternatingMonoPattern> data)
|
||||
{
|
||||
List<CoupledColourEncoding> encodings = new List<CoupledColourEncoding>();
|
||||
CoupledColourEncoding? currentEncoding = null;
|
||||
List<RepeatingHitPatterns> encodings = new List<RepeatingHitPatterns>();
|
||||
RepeatingHitPatterns? currentEncoding = null;
|
||||
|
||||
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.
|
||||
currentEncoding = new CoupledColourEncoding(currentEncoding);
|
||||
currentEncoding = new RepeatingHitPatterns(currentEncoding);
|
||||
|
||||
// Determine if future ColourEncodings should be grouped.
|
||||
bool isCoupled = i < data.Count - 2 && data[i].IsRepetitionOf(data[i + 2]);
|
||||
|
@ -13,16 +13,16 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Preprocessing.Colour
|
||||
/// <summary>
|
||||
/// The <see cref="MonoEncoding"/> that encodes this note, only present if this is the first note within a <see cref="MonoEncoding"/>
|
||||
/// </summary>
|
||||
public MonoEncoding? MonoEncoding;
|
||||
public MonoStreak? MonoEncoding;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="ColourEncoding"/> that encodes this note, only present if this is the first note within a <see cref="ColourEncoding"/>
|
||||
/// </summary>
|
||||
public ColourEncoding? ColourEncoding;
|
||||
public AlternatingMonoPattern? ColourEncoding;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="CoupledColourEncoding"/> that encodes this note, only present if this is the first note within a <see cref="CoupledColourEncoding"/>
|
||||
/// </summary>
|
||||
public CoupledColourEncoding? CoupledColourEncoding;
|
||||
public RepeatingHitPatterns? CoupledColourEncoding;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user