mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Ensure stable sorting order in beatmap conversion tests
This commit is contained in:
@ -83,11 +83,17 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
RandomZ = snapshot.RandomZ;
|
||||
}
|
||||
|
||||
public override void PostProcess()
|
||||
{
|
||||
base.PostProcess();
|
||||
Objects.Sort();
|
||||
}
|
||||
|
||||
public bool Equals(ManiaConvertMapping other) => other != null && RandomW == other.RandomW && RandomX == other.RandomX && RandomY == other.RandomY && RandomZ == other.RandomZ;
|
||||
public override bool Equals(ConvertMapping<ConvertValue> other) => base.Equals(other) && Equals(other as ManiaConvertMapping);
|
||||
}
|
||||
|
||||
public struct ConvertValue : IEquatable<ConvertValue>
|
||||
public struct ConvertValue : IEquatable<ConvertValue>, IComparable<ConvertValue>
|
||||
{
|
||||
/// <summary>
|
||||
/// A sane value to account for osu!stable using ints everwhere.
|
||||
@ -102,5 +108,15 @@ namespace osu.Game.Rulesets.Mania.Tests
|
||||
=> Precision.AlmostEquals(StartTime, other.StartTime, conversion_lenience)
|
||||
&& Precision.AlmostEquals(EndTime, other.EndTime, conversion_lenience)
|
||||
&& Column == other.Column;
|
||||
|
||||
public int CompareTo(ConvertValue other)
|
||||
{
|
||||
var result = StartTime.CompareTo(other.StartTime);
|
||||
|
||||
if (result != 0)
|
||||
return result;
|
||||
|
||||
return Column.CompareTo(other.Column);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user