mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 18:12:56 +08:00
Remove obsolete methods
This commit is contained in:
parent
aaa0f908d5
commit
8b0274fedd
@ -4,7 +4,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@ -180,11 +179,6 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
|
|
||||||
private void apply(HitObject hitObject)
|
private void apply(HitObject hitObject)
|
||||||
{
|
{
|
||||||
#pragma warning disable 618 // can be removed 20200417
|
|
||||||
if (GetType().GetMethod(nameof(AddNested), BindingFlags.NonPublic | BindingFlags.Instance)?.DeclaringType != typeof(DrawableHitObject))
|
|
||||||
return;
|
|
||||||
#pragma warning restore 618
|
|
||||||
|
|
||||||
if (nestedHitObjects.IsValueCreated)
|
if (nestedHitObjects.IsValueCreated)
|
||||||
{
|
{
|
||||||
nestedHitObjects.Value.Clear();
|
nestedHitObjects.Value.Clear();
|
||||||
@ -194,8 +188,6 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
foreach (var h in hitObject.NestedHitObjects)
|
foreach (var h in hitObject.NestedHitObjects)
|
||||||
{
|
{
|
||||||
var drawableNested = CreateNestedHitObject(h) ?? throw new InvalidOperationException($"{nameof(CreateNestedHitObject)} returned null for {h.GetType().ReadableName()}.");
|
var drawableNested = CreateNestedHitObject(h) ?? throw new InvalidOperationException($"{nameof(CreateNestedHitObject)} returned null for {h.GetType().ReadableName()}.");
|
||||||
|
|
||||||
addNested(drawableNested);
|
|
||||||
AddNestedHitObject(drawableNested);
|
AddNestedHitObject(drawableNested);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -208,13 +200,6 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adds a nested <see cref="DrawableHitObject"/>. This should not be used except for legacy nested <see cref="DrawableHitObject"/> usages.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="h"></param>
|
|
||||||
[Obsolete("Use AddNestedHitObject() / ClearNestedHitObjects() / CreateNestedHitObject() instead.")] // can be removed 20200417
|
|
||||||
protected virtual void AddNested(DrawableHitObject h) => addNested(h);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invoked by the base <see cref="DrawableHitObject"/> to remove all previously-added nested <see cref="DrawableHitObject"/>s.
|
/// Invoked by the base <see cref="DrawableHitObject"/> to remove all previously-added nested <see cref="DrawableHitObject"/>s.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -229,17 +214,6 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
/// <returns>The drawable representation for <paramref name="hitObject"/>.</returns>
|
/// <returns>The drawable representation for <paramref name="hitObject"/>.</returns>
|
||||||
protected virtual DrawableHitObject CreateNestedHitObject(HitObject hitObject) => null;
|
protected virtual DrawableHitObject CreateNestedHitObject(HitObject hitObject) => null;
|
||||||
|
|
||||||
private void addNested(DrawableHitObject hitObject)
|
|
||||||
{
|
|
||||||
// Todo: Exists for legacy purposes, can be removed 20200417
|
|
||||||
|
|
||||||
hitObject.OnNewResult += (d, r) => OnNewResult?.Invoke(d, r);
|
|
||||||
hitObject.OnRevertResult += (d, r) => OnRevertResult?.Invoke(d, r);
|
|
||||||
hitObject.ApplyCustomUpdateState += (d, j) => ApplyCustomUpdateState?.Invoke(d, j);
|
|
||||||
|
|
||||||
nestedHitObjects.Value.Add(hitObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
#region State / Transform Management
|
#region State / Transform Management
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user