mirror of
https://github.com/osukey/osukey.git
synced 2025-05-01 19:57:25 +09:00
34 lines
947 B
C#
34 lines
947 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 System;
|
|
|
|
#nullable enable
|
|
|
|
namespace osu.Game.Rulesets.Catch.Edit
|
|
{
|
|
/// <summary>
|
|
/// Represents a closed interval of horizontal positions in the playfield.
|
|
/// </summary>
|
|
public readonly struct PositionRange
|
|
{
|
|
public readonly float Min;
|
|
public readonly float Max;
|
|
|
|
public PositionRange(float value)
|
|
: this(value, value)
|
|
{
|
|
}
|
|
|
|
public PositionRange(float min, float max)
|
|
{
|
|
Min = min;
|
|
Max = max;
|
|
}
|
|
|
|
public static PositionRange Union(PositionRange a, PositionRange b) => new PositionRange(Math.Min(a.Min, b.Min), Math.Max(a.Max, b.Max));
|
|
|
|
public static readonly PositionRange EMPTY = new PositionRange(float.PositiveInfinity, float.NegativeInfinity);
|
|
}
|
|
}
|