2021-07-19 04:03:53 +00:00
|
|
|
// 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 System;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Catch.Objects
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// A vertex of a <see cref="JuiceStreamPath"/>.
|
|
|
|
/// </summary>
|
|
|
|
public readonly struct JuiceStreamPathVertex : IComparable<JuiceStreamPathVertex>
|
|
|
|
{
|
2022-05-08 09:32:01 +00:00
|
|
|
public readonly double Time;
|
2021-07-19 04:03:53 +00:00
|
|
|
|
|
|
|
public readonly float X;
|
|
|
|
|
2022-05-08 09:32:01 +00:00
|
|
|
public JuiceStreamPathVertex(double time, float x)
|
2021-07-19 04:03:53 +00:00
|
|
|
{
|
2022-05-08 09:32:01 +00:00
|
|
|
Time = time;
|
2021-07-19 04:03:53 +00:00
|
|
|
X = x;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int CompareTo(JuiceStreamPathVertex other)
|
|
|
|
{
|
2022-05-08 09:32:01 +00:00
|
|
|
int c = Time.CompareTo(other.Time);
|
2021-07-19 04:03:53 +00:00
|
|
|
return c != 0 ? c : X.CompareTo(other.X);
|
|
|
|
}
|
|
|
|
|
2022-05-08 09:32:01 +00:00
|
|
|
public override string ToString() => $"({Time}, {X})";
|
2021-07-19 04:03:53 +00:00
|
|
|
}
|
|
|
|
}
|