mirror of
https://github.com/ppy/osu.git
synced 2024-11-16 13:17:26 +08:00
72e502e615
Closes https://github.com/ppy/osu/issues/25827. The logic cannot be easily abstracted out (because `CompareReverseChildID()` is protected and non-static on `CompositeDrawable`), so a local copy was applied instead. No testing as any testing would have been purely visual anyways.
27 lines
1023 B
C#
27 lines
1023 B
C#
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Graphics.Containers;
|
|
using osu.Game.Rulesets.UI;
|
|
|
|
namespace osu.Game.Rulesets.Catch.Objects.Drawables
|
|
{
|
|
public partial class NestedFruitContainer : Container
|
|
{
|
|
/// <remarks>
|
|
/// This comparison logic is a copy of <see cref="HitObjectContainer"/> comparison logic,
|
|
/// which can't be easily extracted to a more common place.
|
|
/// </remarks>
|
|
/// <seealso cref="HitObjectContainer.Compare"/>
|
|
protected override int Compare(Drawable x, Drawable y)
|
|
{
|
|
if (x is not DrawableCatchHitObject xObj || y is not DrawableCatchHitObject yObj)
|
|
return base.Compare(x, y);
|
|
|
|
int result = yObj.HitObject.StartTime.CompareTo(xObj.HitObject.StartTime);
|
|
return result == 0 ? CompareReverseChildID(x, y) : result;
|
|
}
|
|
}
|
|
}
|