Remove SliderPiece + HitObjectPiece

This commit is contained in:
smoogipoo 2019-09-27 18:01:55 +09:00
parent f64fe22f36
commit 4fc37d1137
6 changed files with 7 additions and 51 deletions

View File

@ -3,6 +3,7 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
@ -10,12 +11,11 @@ using osuTK;
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components
{
public class HitCirclePiece : HitObjectPiece
public class HitCirclePiece : CompositeDrawable
{
private readonly HitCircle hitCircle;
public HitCirclePiece(HitCircle hitCircle)
: base(hitCircle)
{
this.hitCircle = hitCircle;
Origin = Anchor.Centre;

View File

@ -1,21 +0,0 @@
// 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 osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Osu.Objects;
namespace osu.Game.Rulesets.Osu.Edit.Blueprints
{
/// <summary>
/// A piece of a blueprint which responds to changes in the state of a <see cref="OsuHitObject"/>.
/// </summary>
public abstract class HitObjectPiece : CompositeDrawable
{
protected readonly OsuHitObject HitObject;
protected HitObjectPiece(OsuHitObject hitObject)
{
HitObject = hitObject;
}
}
}

View File

@ -1,21 +0,0 @@
// 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 osu.Game.Rulesets.Osu.Objects;
namespace osu.Game.Rulesets.Osu.Edit.Blueprints
{
/// <summary>
/// A piece of a blueprint which responds to changes in the state of a <see cref="Objects.Slider"/>.
/// </summary>
public abstract class SliderPiece : HitObjectPiece
{
protected readonly Slider Slider;
protected SliderPiece(Slider slider)
: base(slider)
{
Slider = slider;
}
}
}

View File

@ -7,14 +7,13 @@ using osu.Game.Rulesets.Osu.Objects;
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
{
public class PathControlPointVisualiser : SliderPiece
public class PathControlPointVisualiser : CompositeDrawable
{
private readonly Slider slider;
private readonly Container<PathControlPointPiece> pieces;
public PathControlPointVisualiser(Slider slider)
: base(slider)
{
this.slider = slider;

View File

@ -3,6 +3,7 @@
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
@ -11,13 +12,12 @@ using osuTK.Graphics;
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
{
public class SliderBodyPiece : SliderPiece
public class SliderBodyPiece : CompositeDrawable
{
private readonly Slider slider;
private readonly ManualSliderBody body;
public SliderBodyPiece(Slider slider)
: base(slider)
{
this.slider = slider;
@ -40,7 +40,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
base.Update();
Position = slider.StackedPosition;
body.PathRadius = HitObject.Scale * OsuHitObject.OBJECT_RADIUS;
body.PathRadius = slider.Scale * OsuHitObject.OBJECT_RADIUS;
var vertices = new List<Vector2>();
slider.Path.GetPathToProgress(vertices, 0, 1);

View File

@ -12,14 +12,13 @@ using osuTK;
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners.Components
{
public class SpinnerPiece : HitObjectPiece
public class SpinnerPiece : CompositeDrawable
{
private readonly Spinner spinner;
private readonly CircularContainer circle;
private readonly RingPiece ring;
public SpinnerPiece(Spinner spinner)
: base(spinner)
{
this.spinner = spinner;