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 @@ public abstract class HitObjectSelectionBlueprint : SelectionBlueprint<HitObject
/// <summary>
/// The <see cref="DrawableHitObject"/> which this <see cref="HitObjectSelectionBlueprint"/> applies to.
/// </summary>
public virtual DrawableHitObject DrawableObject { get; private set; }
public DrawableHitObject DrawableObject { get; internal set; }
/// <summary>
/// Whether the blueprint should be shown even when the <see cref="DrawableObject"/> is not alive.
@ -28,24 +28,6 @@ protected HitObjectSelectionBlueprint(HitObject hitObject)
{
}
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 Vector2 ScreenSpaceSelectionPoint => DrawableObject.ScreenSpaceDrawQuad.Centre;

View File

@ -245,7 +245,7 @@ protected sealed override SelectionBlueprint<HitObject> CreateBlueprintFor(HitOb
if (drawable == 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;

View File

@ -27,7 +27,7 @@ protected void AddBlueprint(HitObjectSelectionBlueprint blueprint, DrawableHitOb
{
Add(blueprint.With(d =>
{
d.Apply(drawableObject);
d.DrawableObject = drawableObject;
d.Depth = float.MinValue;
d.Select();
}));