Remove OnParentReceived()

This commit is contained in:
smoogipoo
2020-12-03 20:03:39 +09:00
parent 73e99718bc
commit 0bdf99b97a
6 changed files with 29 additions and 67 deletions

View File

@ -18,6 +18,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
public new SliderRepeat HitObject => (SliderRepeat)base.HitObject;
protected DrawableSlider DrawableSlider => (DrawableSlider)ParentHitObject;
private double animDuration;
public Drawable CirclePiece { get; private set; }
@ -26,8 +28,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
public override bool DisplayResult => false;
private DrawableSlider drawableSlider;
public DrawableSliderRepeat()
: base(null)
{
@ -60,24 +60,17 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
ScaleBindable.BindValueChanged(scale => scaleContainer.Scale = new Vector2(scale.NewValue));
}
protected override void OnParentReceived(DrawableHitObject parent)
{
base.OnParentReceived(parent);
drawableSlider = (DrawableSlider)parent;
}
protected override void OnApply()
{
base.OnApply();
Position = HitObject.Position - drawableSlider.Position;
Position = HitObject.Position - DrawableSlider.Position;
}
protected override void CheckForResult(bool userTriggered, double timeOffset)
{
if (HitObject.StartTime <= Time.Current)
ApplyResult(r => r.Type = drawableSlider.Tracking.Value ? r.Judgement.MaxResult : r.Judgement.MinResult);
ApplyResult(r => r.Type = DrawableSlider.Tracking.Value ? r.Judgement.MaxResult : r.Judgement.MinResult);
}
protected override void UpdateInitialTransforms()
@ -119,7 +112,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
if (IsHit) return;
bool isRepeatAtEnd = HitObject.RepeatIndex % 2 == 0;
List<Vector2> curve = ((PlaySliderBody)drawableSlider.Body.Drawable).CurrentCurve;
List<Vector2> curve = ((PlaySliderBody)DrawableSlider.Body.Drawable).CurrentCurve;
Position = isRepeatAtEnd ? end : start;