Remove more code and make some methods private

This commit is contained in:
ekrctb
2020-11-22 18:36:10 +09:00
parent 5247ebaf53
commit c506b438bf
5 changed files with 5 additions and 20 deletions

View File

@ -62,10 +62,10 @@ namespace osu.Game.Rulesets.Catch.UI
protected override void OnNewDrawableHitObject(DrawableHitObject d) protected override void OnNewDrawableHitObject(DrawableHitObject d)
{ {
((DrawableCatchHitObject)d).CheckPosition = CheckIfWeCanCatch; ((DrawableCatchHitObject)d).CheckPosition = checkIfWeCanCatch;
} }
public bool CheckIfWeCanCatch(CatchHitObject obj) => CatcherArea.AttemptCatch(obj); private bool checkIfWeCanCatch(CatchHitObject obj) => CatcherArea.AttemptCatch(obj);
private void onNewResult(DrawableHitObject judgedObject, JudgementResult result) private void onNewResult(DrawableHitObject judgedObject, JudgementResult result)
=> CatcherArea.OnNewResult((DrawableCatchHitObject)judgedObject, result); => CatcherArea.OnNewResult((DrawableCatchHitObject)judgedObject, result);

View File

@ -19,7 +19,7 @@ using osuTK;
namespace osu.Game.Rulesets.Osu.Objects.Drawables namespace osu.Game.Rulesets.Osu.Objects.Drawables
{ {
public class DrawableHitCircle : DrawableOsuHitObject, IDrawableHitObjectWithProxiedApproach public class DrawableHitCircle : DrawableOsuHitObject
{ {
public OsuAction? HitAction => HitArea.HitAction; public OsuAction? HitAction => HitArea.HitAction;
protected virtual OsuSkinComponents CirclePieceComponent => OsuSkinComponents.HitCircle; protected virtual OsuSkinComponents CirclePieceComponent => OsuSkinComponents.HitCircle;

View File

@ -19,7 +19,7 @@ using osu.Game.Skinning;
namespace osu.Game.Rulesets.Osu.Objects.Drawables namespace osu.Game.Rulesets.Osu.Objects.Drawables
{ {
public class DrawableSlider : DrawableOsuHitObject, IDrawableHitObjectWithProxiedApproach public class DrawableSlider : DrawableOsuHitObject
{ {
public new Slider HitObject => (Slider)base.HitObject; public new Slider HitObject => (Slider)base.HitObject;

View File

@ -26,8 +26,6 @@ namespace osu.Game.Rulesets.Osu.UI
{ {
public class OsuPlayfield : Playfield public class OsuPlayfield : Playfield
{ {
public readonly Func<DrawableHitObject, double, bool> CheckHittable;
private readonly PlayfieldBorder playfieldBorder; private readonly PlayfieldBorder playfieldBorder;
private readonly ProxyContainer approachCircles; private readonly ProxyContainer approachCircles;
private readonly ProxyContainer spinnerProxies; private readonly ProxyContainer spinnerProxies;
@ -57,7 +55,6 @@ namespace osu.Game.Rulesets.Osu.UI
}; };
hitPolicy = new OrderedHitPolicy(HitObjectContainer); hitPolicy = new OrderedHitPolicy(HitObjectContainer);
CheckHittable = hitPolicy.IsHittable;
var hitWindows = new OsuHitWindows(); var hitWindows = new OsuHitWindows();
@ -71,7 +68,7 @@ namespace osu.Game.Rulesets.Osu.UI
protected override void OnNewDrawableHitObject(DrawableHitObject drawable) protected override void OnNewDrawableHitObject(DrawableHitObject drawable)
{ {
((DrawableOsuHitObject)drawable).CheckHittable = CheckHittable; ((DrawableOsuHitObject)drawable).CheckHittable = hitPolicy.IsHittable;
Debug.Assert(!drawable.IsLoaded, $"Already loaded {nameof(DrawableHitObject)} is added to {nameof(OsuPlayfield)}"); Debug.Assert(!drawable.IsLoaded, $"Already loaded {nameof(DrawableHitObject)} is added to {nameof(OsuPlayfield)}");
drawable.OnLoadComplete += onDrawableHitObjectLoaded; drawable.OnLoadComplete += onDrawableHitObjectLoaded;

View File

@ -1,12 +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;
namespace osu.Game.Rulesets.Objects.Drawables
{
public interface IDrawableHitObjectWithProxiedApproach
{
Drawable ProxiedLayer { get; }
}
}