-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from goodtrailer/fix-hold-statistics
Statistics: Fix statistics hit distribution graph for Hold objects
- Loading branch information
Showing
7 changed files
with
449 additions
and
9 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
osu.Game.Rulesets.Soyokaze/Judgements/SoyokazeHoldJudgementResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (c) Alden Wu <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENSE file in the repository root for full licence text. | ||
|
||
using osu.Game.Rulesets.Judgements; | ||
using osu.Game.Rulesets.Soyokaze.Objects; | ||
|
||
namespace osu.Game.Rulesets.Soyokaze.Judgements | ||
{ | ||
public class SoyokazeHoldJudgementResult : JudgementResult | ||
{ | ||
public double TrueTimeOffset { get; set; } | ||
|
||
public SoyokazeHoldJudgementResult(Hold hitObject, Judgement judgement) | ||
: base(hitObject, judgement) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
// Copyright (c) Alden Wu <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENSE file in the repository root for full licence text. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using osu.Framework.Allocation; | ||
using osu.Framework.Graphics; | ||
|
@@ -11,6 +13,7 @@ | |
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Rulesets.Objects.Drawables; | ||
using osu.Game.Rulesets.Scoring; | ||
using osu.Game.Rulesets.Soyokaze.Judgements; | ||
using osu.Game.Rulesets.Soyokaze.Skinning; | ||
using osu.Game.Rulesets.Soyokaze.UI; | ||
using osu.Game.Skinning; | ||
|
@@ -169,6 +172,8 @@ protected override void UpdateHitStateTransforms(ArmedState state) | |
} | ||
} | ||
|
||
protected override JudgementResult CreateResult(Judgement judgement) => new SoyokazeHoldJudgementResult(HitObject, judgement); | ||
|
||
protected override void CheckForResult(bool userTriggered, double timeOffset) | ||
{ | ||
if (userTriggered || Time.Current < HitObject.EndTime) | ||
|
@@ -207,7 +212,14 @@ protected override void CheckForResult(bool userTriggered, double timeOffset) | |
else | ||
result = HitResult.Miss; | ||
|
||
ApplyResult(r => r.Type = result); | ||
ApplyResult(r => | ||
{ | ||
if (!(r is SoyokazeHoldJudgementResult hr)) | ||
throw new InvalidOperationException($"Expected result of type {nameof(SoyokazeHoldJudgementResult)}"); | ||
|
||
hr.Type = result; | ||
hr.TrueTimeOffset = HoldCircle.TrueTimeOffset; | ||
}); | ||
} | ||
|
||
public override bool Hit(SoyokazeAction action) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
osu.Game.Rulesets.Soyokaze/Scoring/SoyokazeScoreProcessor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) Alden Wu <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENSE file in the repository root for full licence text. | ||
|
||
using osu.Game.Rulesets.Judgements; | ||
using osu.Game.Rulesets.Scoring; | ||
using osu.Game.Rulesets.Soyokaze.Judgements; | ||
|
||
namespace osu.Game.Rulesets.Soyokaze.Scoring | ||
{ | ||
public partial class SoyokazeScoreProcessor : ScoreProcessor | ||
{ | ||
public SoyokazeScoreProcessor(Ruleset ruleset) | ||
: base(ruleset) | ||
{ | ||
} | ||
|
||
protected override HitEvent CreateHitEvent(JudgementResult result) | ||
{ | ||
var hitEvent = base.CreateHitEvent(result); | ||
|
||
if (result is SoyokazeHoldJudgementResult hr) | ||
hitEvent = new HitEvent(hr.TrueTimeOffset, hitEvent.Result, hitEvent.HitObject, hitEvent.LastHitObject, hitEvent.Position); | ||
|
||
return hitEvent; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.