1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 16:47:29 +08:00

Create HO-specific nested hit types

This commit is contained in:
Bartłomiej Dach 2020-12-13 12:59:46 +01:00
parent 4d444df6b3
commit 61c488cd5e
6 changed files with 28 additions and 3 deletions

View File

@ -92,7 +92,7 @@ namespace osu.Game.Rulesets.Taiko.Tests.Skinning
createDrawableRuleset(); createDrawableRuleset();
assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Great }, TaikoMascotAnimationState.Idle); assertStateAfterResult(new JudgementResult(new Hit(), new TaikoJudgement()) { Type = HitResult.Great }, TaikoMascotAnimationState.Idle);
assertStateAfterResult(new JudgementResult(new StrongNestedHitObject(), new TaikoStrongJudgement()) { Type = HitResult.IgnoreMiss }, TaikoMascotAnimationState.Idle); assertStateAfterResult(new JudgementResult(new Hit.StrongNestedHit(), new TaikoStrongJudgement()) { Type = HitResult.IgnoreMiss }, TaikoMascotAnimationState.Idle);
} }
[Test] [Test]

View File

@ -109,6 +109,12 @@ namespace osu.Game.Rulesets.Taiko.Objects
protected override HitWindows CreateHitWindows() => HitWindows.Empty; protected override HitWindows CreateHitWindows() => HitWindows.Empty;
protected override StrongNestedHitObject CreateStrongNestedHit(double startTime) => new StrongNestedHit { StartTime = startTime };
public class StrongNestedHit : StrongNestedHitObject
{
}
#region LegacyBeatmapEncoder #region LegacyBeatmapEncoder
double IHasDistance.Distance => Duration * Velocity; double IHasDistance.Distance => Duration * Velocity;

View File

@ -28,5 +28,11 @@ namespace osu.Game.Rulesets.Taiko.Objects
public override Judgement CreateJudgement() => new TaikoDrumRollTickJudgement(); public override Judgement CreateJudgement() => new TaikoDrumRollTickJudgement();
protected override HitWindows CreateHitWindows() => HitWindows.Empty; protected override HitWindows CreateHitWindows() => HitWindows.Empty;
protected override StrongNestedHitObject CreateStrongNestedHit(double startTime) => new StrongNestedHit { StartTime = startTime };
public class StrongNestedHit : StrongNestedHitObject
{
}
} }
} }

View File

@ -17,5 +17,11 @@ namespace osu.Game.Rulesets.Taiko.Objects
get => TypeBindable.Value; get => TypeBindable.Value;
set => TypeBindable.Value = value; set => TypeBindable.Value = value;
} }
protected override StrongNestedHitObject CreateStrongNestedHit(double startTime) => new StrongNestedHit { StartTime = startTime };
public class StrongNestedHit : StrongNestedHitObject
{
}
} }
} }

View File

@ -7,7 +7,7 @@ using osu.Game.Rulesets.Taiko.Judgements;
namespace osu.Game.Rulesets.Taiko.Objects namespace osu.Game.Rulesets.Taiko.Objects
{ {
public class StrongNestedHitObject : TaikoHitObject public abstract class StrongNestedHitObject : TaikoHitObject
{ {
public override Judgement CreateJudgement() => new TaikoStrongJudgement(); public override Judgement CreateJudgement() => new TaikoStrongJudgement();

View File

@ -36,7 +36,14 @@ namespace osu.Game.Rulesets.Taiko.Objects
base.CreateNestedHitObjects(cancellationToken); base.CreateNestedHitObjects(cancellationToken);
if (IsStrong) if (IsStrong)
AddNested(new StrongNestedHitObject { StartTime = this.GetEndTime() }); AddNested(CreateStrongNestedHit(this.GetEndTime()));
} }
/// <summary>
/// Creates a <see cref="StrongNestedHitObject"/> representing a second hit on this object.
/// This is only called if <see cref="IsStrong"/> is true.
/// </summary>
/// <param name="startTime">The start time of the nested hit.</param>
protected abstract StrongNestedHitObject CreateStrongNestedHit(double startTime);
} }
} }