diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs index eeca1b1da3..458c4d7c80 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableDrumRollTick.cs @@ -2,28 +2,19 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using System.Linq; using osu.Framework.Graphics; -using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; -using osu.Game.Rulesets.Taiko.Judgements; using osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces; namespace osu.Game.Rulesets.Taiko.Objects.Drawables { public class DrawableDrumRollTick : DrawableTaikoHitObject { - private readonly JudgementResult result; - private readonly JudgementResult strongResult; - public DrawableDrumRollTick(DrumRollTick tick) : base(tick) { FillMode = FillMode.Fit; - - result = Results.Single(r => !(r.Judgement is TaikoStrongHitJudgement)); - strongResult = Results.SingleOrDefault(r => r.Judgement is TaikoStrongHitJudgement); } public override bool DisplayJudgement => false; @@ -38,21 +29,14 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables if (!userTriggered) { if (timeOffset > HitObject.HitWindow) - { - ApplyResult(result, r => r.Type = HitResult.Miss); - if (HitObject.IsStrong) - ApplyResult(strongResult, r => r.Type = HitResult.Miss); - } - + ApplyResult(r => r.Type = HitResult.Miss); return; } if (Math.Abs(timeOffset) > HitObject.HitWindow) return; - ApplyResult(result, r => r.Type = HitResult.Great); - if (HitObject.IsStrong) - ApplyResult(strongResult, r => r.Type = HitResult.Great); + ApplyResult(r => r.Type = HitResult.Great); } protected override void UpdateState(ArmedState state) @@ -66,5 +50,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables } public override bool OnPressed(TaikoAction action) => UpdateJudgement(true); + + protected override DrawableStrongHitObject CreateStrongObject(StrongHitObject hitObject) => new DrawableStrongDrumRollTick(hitObject, this); } } diff --git a/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongDrumRollTick.cs b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongDrumRollTick.cs new file mode 100644 index 0000000000..6b821ead84 --- /dev/null +++ b/osu.Game.Rulesets.Taiko/Objects/Drawables/DrawableStrongDrumRollTick.cs @@ -0,0 +1,28 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Game.Rulesets.Scoring; + +namespace osu.Game.Rulesets.Taiko.Objects.Drawables +{ + public class DrawableStrongDrumRollTick : DrawableStrongHitObject + { + private readonly DrawableDrumRollTick tick; + + public DrawableStrongDrumRollTick(StrongHitObject strong, DrawableDrumRollTick tick) + : base(strong) + { + this.tick = tick; + } + + protected override void CheckForJudgements(bool userTriggered, double timeOffset) + { + if (!tick.Judged) + return; + + ApplyResult(r => r.Type = tick.IsHit ? HitResult.Great : HitResult.Miss); + } + + public override bool OnPressed(TaikoAction action) => false; + } +}