Make Rulesets.Taiko use the new judgement result structure

This commit is contained in:
smoogipoo
2018-08-02 20:36:08 +09:00
parent 3619290c34
commit 9c2122c0ca
13 changed files with 96 additions and 106 deletions

View File

@ -19,16 +19,16 @@ namespace osu.Game.Rulesets.Taiko.UI
/// Creates a new judgement text.
/// </summary>
/// <param name="judgedObject">The object which is being judged.</param>
/// <param name="judgement">The judgement to visualise.</param>
public DrawableTaikoJudgement(Judgement judgement, DrawableHitObject judgedObject)
: base(judgement, judgedObject)
/// <param name="result">The judgement to visualise.</param>
public DrawableTaikoJudgement(JudgementResult result, DrawableHitObject judgedObject)
: base(result, judgedObject)
{
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
switch (Judgement.Result)
switch (Result.Type)
{
case HitResult.Good:
Colour = colours.GreenLight;
@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Taiko.UI
protected override void LoadComplete()
{
if (Judgement.IsHit)
if (Result.IsHit)
this.MoveToY(-100, 500);
base.LoadComplete();

View File

@ -224,28 +224,28 @@ namespace osu.Game.Rulesets.Taiko.UI
}
}
internal void OnJudgement(DrawableHitObject judgedObject, Judgement judgement)
internal void OnJudgement(DrawableHitObject judgedObject, JudgementResult result)
{
if (!DisplayJudgements)
return;
if (judgedObject.DisplayJudgement && judgementContainer.FirstOrDefault(j => j.JudgedObject == judgedObject) == null)
{
judgementContainer.Add(new DrawableTaikoJudgement(judgement, judgedObject)
judgementContainer.Add(new DrawableTaikoJudgement(result, judgedObject)
{
Anchor = judgement.IsHit ? Anchor.TopLeft : Anchor.CentreLeft,
Origin = judgement.IsHit ? Anchor.BottomCentre : Anchor.Centre,
Anchor = result.IsHit ? Anchor.TopLeft : Anchor.CentreLeft,
Origin = result.IsHit ? Anchor.BottomCentre : Anchor.Centre,
RelativePositionAxes = Axes.X,
X = judgement.IsHit ? judgedObject.Position.X : 0,
X = result.IsHit ? judgedObject.Position.X : 0,
});
}
if (!judgement.IsHit)
if (!result.IsHit)
return;
bool isRim = judgedObject.HitObject is RimHit;
if (judgement is TaikoStrongHitJudgement)
if (result.Judgement is TaikoStrongHitJudgement)
hitExplosionContainer.Children.FirstOrDefault(e => e.JudgedObject == judgedObject)?.VisualiseSecondHit();
else
{