mirror of
https://github.com/ppy/osu.git
synced 2025-01-16 22:03:22 +08:00
54ab256c8e
# Conflicts: # osu.Game.Rulesets.Catch/Beatmaps/CatchBeatmapConverter.cs # osu.Game.Rulesets.Catch/Objects/JuiceStream.cs # osu.Game.Rulesets.Osu/Beatmaps/OsuBeatmapConverter.cs # osu.Game/Rulesets/Objects/Legacy/Catch/ConvertHitObjectParser.cs # osu.Game/Rulesets/Objects/Legacy/Mania/ConvertHitObjectParser.cs # osu.Game/Rulesets/Objects/Legacy/Osu/ConvertHitObjectParser.cs # osu.Game/Rulesets/Objects/Legacy/Taiko/ConvertHitObjectParser.cs # osu.Game/Rulesets/Objects/SliderPath.cs
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components;
|
|
using osu.Game.Rulesets.Osu.Objects;
|
|
|
|
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|
{
|
|
public class SliderCirclePiece : HitCirclePiece
|
|
{
|
|
private readonly Slider slider;
|
|
private readonly SliderPosition position;
|
|
|
|
public SliderCirclePiece(Slider slider, SliderPosition position)
|
|
: base(slider.HeadCircle)
|
|
{
|
|
this.slider = slider;
|
|
this.position = position;
|
|
|
|
slider.PathChanged += _ => UpdatePosition();
|
|
}
|
|
|
|
protected override void UpdatePosition()
|
|
{
|
|
switch (position)
|
|
{
|
|
case SliderPosition.Start:
|
|
Position = slider.StackedPosition + slider.Path.PositionAt(0);
|
|
break;
|
|
case SliderPosition.End:
|
|
Position = slider.StackedPosition + slider.Path.PositionAt(1);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|