mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Make ScoreProcessors take generic judgements.
This commit is contained in:
@ -25,14 +25,6 @@ namespace osu.Game.Modes.UI
|
||||
/// </summary>
|
||||
public abstract class HitRenderer : Container
|
||||
{
|
||||
/// <summary>
|
||||
/// The event that's fired when a hit object is judged.
|
||||
/// </summary>
|
||||
public event Action<JudgementInfo> OnJudgement;
|
||||
|
||||
/// <summary>
|
||||
/// The event that's fired when all hit objects have been judged.
|
||||
/// </summary>
|
||||
public event Action OnAllJudged;
|
||||
|
||||
/// <summary>
|
||||
@ -57,17 +49,16 @@ namespace osu.Game.Modes.UI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Triggers a judgement for further processing.
|
||||
/// Checks whether all HitObjects have been judged, and invokes OnAllJudged.
|
||||
/// </summary>
|
||||
/// <param name="j">The judgement to trigger.</param>
|
||||
protected void TriggerOnJudgement(JudgementInfo j)
|
||||
protected void CheckAllJudged()
|
||||
{
|
||||
OnJudgement?.Invoke(j);
|
||||
|
||||
if (AllObjectsJudged)
|
||||
OnAllJudged?.Invoke();
|
||||
}
|
||||
|
||||
public abstract ScoreProcessor CreateScoreProcessor();
|
||||
|
||||
/// <summary>
|
||||
/// Creates a key conversion input manager.
|
||||
/// </summary>
|
||||
@ -141,6 +132,8 @@ namespace osu.Game.Modes.UI
|
||||
where TObject : HitObject
|
||||
where TJudgement : JudgementInfo
|
||||
{
|
||||
public event Action<TJudgement> OnJudgement;
|
||||
|
||||
protected override Container<Drawable> Content => content;
|
||||
protected override bool AllObjectsJudged => Playfield.HitObjects.Children.All(h => h.Judgement.Result.HasValue);
|
||||
|
||||
@ -197,8 +190,10 @@ namespace osu.Game.Modes.UI
|
||||
/// <param name="judgedObject">The object that Judgement has been updated for.</param>
|
||||
private void onJudgement(DrawableHitObject<TObject, TJudgement> judgedObject)
|
||||
{
|
||||
TriggerOnJudgement(judgedObject.Judgement);
|
||||
OnJudgement?.Invoke(judgedObject.Judgement);
|
||||
Playfield.OnJudgement(judgedObject);
|
||||
|
||||
CheckAllJudged();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Reference in New Issue
Block a user