osu/osu.Game/Beatmaps/ControlPoints/ControlPoint.cs

33 lines
1.3 KiB
C#
Raw Normal View History

2019-10-25 10:58:42 +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.
2018-04-13 09:19:50 +00:00
using System;
using osu.Game.Graphics;
using osuTK.Graphics;
2018-04-13 09:19:50 +00:00
namespace osu.Game.Beatmaps.ControlPoints
{
2020-04-17 08:04:09 +00:00
public abstract class ControlPoint : IComparable<ControlPoint>
2018-04-13 09:19:50 +00:00
{
/// <summary>
/// The time at which the control point takes effect.
/// </summary>
2019-10-25 10:48:01 +00:00
public double Time => controlPointGroup?.Time ?? 0;
2018-04-13 09:19:50 +00:00
2019-10-25 10:48:01 +00:00
private ControlPointGroup controlPointGroup;
2019-11-12 10:24:19 +00:00
public void AttachGroup(ControlPointGroup pointGroup) => controlPointGroup = pointGroup;
2019-10-25 10:48:01 +00:00
2018-04-13 09:19:50 +00:00
public int CompareTo(ControlPoint other) => Time.CompareTo(other.Time);
public virtual Color4 GetRepresentingColour(OsuColour colours) => colours.Yellow;
2020-04-08 08:42:35 +00:00
/// <summary>
2020-04-17 08:06:12 +00:00
/// Determines whether this <see cref="ControlPoint"/> results in a meaningful change when placed alongside another.
2020-04-08 08:42:35 +00:00
/// </summary>
2020-04-09 16:34:40 +00:00
/// <param name="existing">An existing control point to compare with.</param>
2020-04-17 08:06:12 +00:00
/// <returns>Whether this <see cref="ControlPoint"/> is redundant when placed alongside <paramref name="existing"/>.</returns>
public abstract bool IsRedundant(ControlPoint existing);
2018-04-13 09:19:50 +00:00
}
}