// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Bindables; using osu.Game.Rulesets.Objects.Types; using osuTK; namespace osu.Game.Rulesets.Objects { public class PathControlPoint : IEquatable { /// /// The position of this . /// public readonly Bindable Position = new Bindable(); /// /// The type of path segment starting at this . /// If null, this will be a part of the previous path segment. /// public readonly Bindable Type = new Bindable(); /// /// Invoked when any property of this is changed. /// internal event Action Changed; /// /// Creates a new . /// public PathControlPoint() : this(Vector2.Zero, null) { } /// /// Creates a new with a provided position and type. /// /// The initial position. /// The initial type. public PathControlPoint(Vector2 position, PathType? type = null) { Position.Value = position; Type.Value = type; Position.ValueChanged += _ => Changed?.Invoke(); Type.ValueChanged += _ => Changed?.Invoke(); } public bool Equals(PathControlPoint other) => Position.Value == other?.Position.Value && Type.Value == other.Type.Value; } }