1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-11 16:57:21 +08:00

Remove now unnecessary Apply() method

This commit is contained in:
smoogipoo 2021-05-18 14:26:26 +09:00
parent 72beddaadc
commit 882d54a8f8
3 changed files with 3 additions and 21 deletions

View File

@ -14,7 +14,7 @@ namespace osu.Game.Rulesets.Edit
/// <summary> /// <summary>
/// The <see cref="DrawableHitObject"/> which this <see cref="HitObjectSelectionBlueprint"/> applies to. /// The <see cref="DrawableHitObject"/> which this <see cref="HitObjectSelectionBlueprint"/> applies to.
/// </summary> /// </summary>
public virtual DrawableHitObject DrawableObject { get; private set; } public DrawableHitObject DrawableObject { get; internal set; }
/// <summary> /// <summary>
/// Whether the blueprint should be shown even when the <see cref="DrawableObject"/> is not alive. /// Whether the blueprint should be shown even when the <see cref="DrawableObject"/> is not alive.
@ -28,24 +28,6 @@ namespace osu.Game.Rulesets.Edit
{ {
} }
protected override void LoadAsyncComplete()
{
// Must be done before base.LoadAsyncComplete() as this may affect children.
Apply(DrawableObject);
base.LoadAsyncComplete();
}
/// <summary>
/// Applies a <see cref="DrawableHitObject"/> to this <see cref="HitObjectSelectionBlueprint"/>.
/// The represented <see cref="HitObject"/> model does not change.
/// </summary>
/// <param name="drawableObject">The new <see cref="DrawableHitObject"/>.</param>
public virtual void Apply(DrawableHitObject drawableObject)
{
DrawableObject = drawableObject;
}
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => DrawableObject.ReceivePositionalInputAt(screenSpacePos); public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => DrawableObject.ReceivePositionalInputAt(screenSpacePos);
public override Vector2 ScreenSpaceSelectionPoint => DrawableObject.ScreenSpaceDrawQuad.Centre; public override Vector2 ScreenSpaceSelectionPoint => DrawableObject.ScreenSpaceDrawQuad.Centre;

View File

@ -245,7 +245,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
if (drawable == null) if (drawable == null)
return null; return null;
return CreateHitObjectBlueprintFor(item).With(b => b.Apply(drawable)); return CreateHitObjectBlueprintFor(item).With(b => b.DrawableObject = drawable);
} }
public virtual HitObjectSelectionBlueprint CreateHitObjectBlueprintFor(HitObject hitObject) => null; public virtual HitObjectSelectionBlueprint CreateHitObjectBlueprintFor(HitObject hitObject) => null;

View File

@ -27,7 +27,7 @@ namespace osu.Game.Tests.Visual
{ {
Add(blueprint.With(d => Add(blueprint.With(d =>
{ {
d.Apply(drawableObject); d.DrawableObject = drawableObject;
d.Depth = float.MinValue; d.Depth = float.MinValue;
d.Select(); d.Select();
})); }));