1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 06:23:21 +08:00

Scope drawable nested hits more closely to models

This commit is contained in:
Bartłomiej Dach 2020-12-13 14:38:16 +01:00
parent 61c488cd5e
commit 091b08b507
4 changed files with 13 additions and 12 deletions

View File

@ -19,7 +19,7 @@ using osuTK;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{ {
public class DrawableDrumRoll : DrawableTaikoStrongHitObject<DrumRoll> public class DrawableDrumRoll : DrawableTaikoStrongHitObject<DrumRoll, DrumRoll.StrongNestedHit>
{ {
/// <summary> /// <summary>
/// Number of rolling hits required to reach the dark/final colour. /// Number of rolling hits required to reach the dark/final colour.
@ -154,7 +154,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
Content.X = DrawHeight / 2; Content.X = DrawHeight / 2;
} }
protected override DrawableStrongNestedHit CreateStrongNestedHit(StrongNestedHitObject hitObject) => new StrongNestedHit(hitObject, this); protected override DrawableStrongNestedHit CreateStrongNestedHit(DrumRoll.StrongNestedHit hitObject) => new StrongNestedHit(hitObject, this);
private void updateColour() private void updateColour()
{ {
@ -164,7 +164,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
private class StrongNestedHit : DrawableStrongNestedHit private class StrongNestedHit : DrawableStrongNestedHit
{ {
public StrongNestedHit(StrongNestedHitObject nestedHit, DrawableDrumRoll drumRoll) public StrongNestedHit(DrumRoll.StrongNestedHit nestedHit, DrawableDrumRoll drumRoll)
: base(nestedHit, drumRoll) : base(nestedHit, drumRoll)
{ {
} }

View File

@ -9,7 +9,7 @@ using osu.Game.Skinning;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{ {
public class DrawableDrumRollTick : DrawableTaikoStrongHitObject<DrumRollTick> public class DrawableDrumRollTick : DrawableTaikoStrongHitObject<DrumRollTick, DrumRollTick.StrongNestedHit>
{ {
/// <summary> /// <summary>
/// The hit type corresponding to the <see cref="TaikoAction"/> that the user pressed to hit this <see cref="DrawableDrumRollTick"/>. /// The hit type corresponding to the <see cref="TaikoAction"/> that the user pressed to hit this <see cref="DrawableDrumRollTick"/>.
@ -61,11 +61,11 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
return UpdateResult(true); return UpdateResult(true);
} }
protected override DrawableStrongNestedHit CreateStrongNestedHit(StrongNestedHitObject hitObject) => new StrongNestedHit(hitObject, this); protected override DrawableStrongNestedHit CreateStrongNestedHit(DrumRollTick.StrongNestedHit hitObject) => new StrongNestedHit(hitObject, this);
private class StrongNestedHit : DrawableStrongNestedHit private class StrongNestedHit : DrawableStrongNestedHit
{ {
public StrongNestedHit(StrongNestedHitObject nestedHit, DrawableDrumRollTick tick) public StrongNestedHit(DrumRollTick.StrongNestedHit nestedHit, DrawableDrumRollTick tick)
: base(nestedHit, tick) : base(nestedHit, tick)
{ {
} }

View File

@ -16,7 +16,7 @@ using osu.Game.Skinning;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{ {
public class DrawableHit : DrawableTaikoStrongHitObject<Hit> public class DrawableHit : DrawableTaikoStrongHitObject<Hit, Hit.StrongNestedHit>
{ {
/// <summary> /// <summary>
/// A list of keys which can result in hits for this HitObject. /// A list of keys which can result in hits for this HitObject.
@ -228,7 +228,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
} }
} }
protected override DrawableStrongNestedHit CreateStrongNestedHit(StrongNestedHitObject hitObject) => new StrongNestedHit(hitObject, this); protected override DrawableStrongNestedHit CreateStrongNestedHit(Hit.StrongNestedHit hitObject) => new StrongNestedHit(hitObject, this);
private class StrongNestedHit : DrawableStrongNestedHit private class StrongNestedHit : DrawableStrongNestedHit
{ {
@ -240,7 +240,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
public new DrawableHit MainObject => (DrawableHit)base.MainObject; public new DrawableHit MainObject => (DrawableHit)base.MainObject;
public StrongNestedHit(StrongNestedHitObject nestedHit, DrawableHit hit) public StrongNestedHit(Hit.StrongNestedHit nestedHit, DrawableHit hit)
: base(nestedHit, hit) : base(nestedHit, hit)
{ {
} }

View File

@ -12,8 +12,9 @@ using osuTK;
namespace osu.Game.Rulesets.Taiko.Objects.Drawables namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{ {
public abstract class DrawableTaikoStrongHitObject<TObject> : DrawableTaikoHitObject<TObject> public abstract class DrawableTaikoStrongHitObject<TObject, TStrongNestedObject> : DrawableTaikoHitObject<TObject>
where TObject : TaikoStrongHitObject where TObject : TaikoStrongHitObject
where TStrongNestedObject : StrongNestedHitObject
{ {
private readonly Bindable<bool> isStrong; private readonly Bindable<bool> isStrong;
@ -92,7 +93,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{ {
switch (hitObject) switch (hitObject)
{ {
case StrongNestedHitObject strong: case TStrongNestedObject strong:
return CreateStrongNestedHit(strong); return CreateStrongNestedHit(strong);
} }
@ -105,6 +106,6 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
/// </summary> /// </summary>
/// <param name="hitObject">The strong hitobject.</param> /// <param name="hitObject">The strong hitobject.</param>
/// <returns>The strong hitobject handler.</returns> /// <returns>The strong hitobject handler.</returns>
protected abstract DrawableStrongNestedHit CreateStrongNestedHit(StrongNestedHitObject hitObject); protected abstract DrawableStrongNestedHit CreateStrongNestedHit(TStrongNestedObject hitObject);
} }
} }