Move CreateCirclePiece to DrawableTaikoHitObject and simplify strong creation.

This commit is contained in:
Dean Herbert 2017-04-04 12:53:06 +09:00
parent cbb669add3
commit 20a5648b05
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
8 changed files with 10 additions and 24 deletions

View File

@ -15,6 +15,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables
public DrawableCentreHit(Hit hit)
: base(hit)
{
Circle.Add(new CentreHitSymbolPiece());
}
[BackgroundDependencyLoader]
@ -22,10 +23,5 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables
{
Circle.AccentColour = colours.PinkDarker;
}
protected override CirclePiece CreateCirclePiece() => new CirclePiece
{
Children = new[] { new CentreHitSymbolPiece() }
};
}
}

View File

@ -110,7 +110,5 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables
protected override void UpdateState(ArmedState state)
{
}
protected virtual CirclePiece CreateCirclePiece() => new CirclePiece();
}
}

View File

@ -109,7 +109,5 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables
Expire();
}
protected abstract CirclePiece CreateCirclePiece();
}
}

View File

@ -15,6 +15,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables
public DrawableRimHit(Hit hit)
: base(hit)
{
Circle.Add(new RimHitSymbolPiece());
}
[BackgroundDependencyLoader]
@ -22,10 +23,5 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables
{
Circle.AccentColour = colours.BlueDarker;
}
protected override CirclePiece CreateCirclePiece() => new CirclePiece
{
Children = new[] { new RimHitSymbolPiece() }
};
}
}

View File

@ -15,6 +15,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables
public DrawableStrongCentreHit(Hit hit)
: base(hit)
{
Circle.Add(new CentreHitSymbolPiece());
}
[BackgroundDependencyLoader]
@ -22,10 +23,5 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables
{
Circle.AccentColour = colours.PinkDarker;
}
protected override CirclePiece CreateCirclePiece() => new StrongCirclePiece
{
Children = new[] { new CentreHitSymbolPiece() }
};
}
}

View File

@ -6,6 +6,7 @@ using System.Linq;
using osu.Framework.Input;
using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Taiko.Judgements;
using osu.Game.Modes.Taiko.Objects.Drawables.Pieces;
using OpenTK.Input;
namespace osu.Game.Modes.Taiko.Objects.Drawables
@ -29,6 +30,8 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables
protected override TaikoJudgement CreateJudgement() => new TaikoStrongHitJudgement();
protected override CirclePiece CreateCirclePiece() => new StrongCirclePiece();
protected override void CheckJudgement(bool userTriggered)
{
if (Judgement.Result == HitResult.None)

View File

@ -15,6 +15,7 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables
public DrawableStrongRimHit(Hit hit)
: base(hit)
{
Circle.Add(new RimHitSymbolPiece());
}
[BackgroundDependencyLoader]
@ -22,10 +23,5 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables
{
Circle.AccentColour = colours.BlueDarker;
}
protected override CirclePiece CreateCirclePiece() => new StrongCirclePiece
{
Children = new[] { new RimHitSymbolPiece() }
};
}
}

View File

@ -6,6 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Input;
using osu.Game.Modes.Objects.Drawables;
using osu.Game.Modes.Taiko.Judgements;
using osu.Game.Modes.Taiko.Objects.Drawables.Pieces;
using OpenTK.Input;
namespace osu.Game.Modes.Taiko.Objects.Drawables
@ -36,6 +37,8 @@ namespace osu.Game.Modes.Taiko.Objects.Drawables
protected override TaikoJudgement CreateJudgement() => new TaikoJudgement();
protected virtual CirclePiece CreateCirclePiece() => new CirclePiece();
/// <summary>
/// Sets the scroll position of the DrawableHitObject relative to the offset between
/// a time value and the HitObject's StartTime.