mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Add the concept of nested DrawableHitObjects.
- Applies to Slider Ticks and start circle. repeat/endpoints still need addressing. - Removed SliderTicksLayer abstraction for now.
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using osu.Framework;
|
||||
@ -23,8 +24,6 @@ namespace osu.Game.Modes.Objects.Drawables
|
||||
|
||||
public bool Interactive = true;
|
||||
|
||||
public Container<DrawableHitObject> ChildObjects;
|
||||
|
||||
public JudgementInfo Judgement;
|
||||
|
||||
public abstract JudgementInfo CreateJudgementInfo();
|
||||
@ -85,6 +84,19 @@ namespace osu.Game.Modes.Objects.Drawables
|
||||
Expire(true);
|
||||
}
|
||||
|
||||
private List<DrawableHitObject> nestedHitObjects;
|
||||
|
||||
protected IEnumerable<DrawableHitObject> NestedHitObjects => nestedHitObjects;
|
||||
|
||||
protected void AddNested(DrawableHitObject h)
|
||||
{
|
||||
if (nestedHitObjects == null)
|
||||
nestedHitObjects = new List<DrawableHitObject>();
|
||||
|
||||
h.OnJudgement += (d, j) => { OnJudgement?.Invoke(d, j); } ;
|
||||
nestedHitObjects.Add(h);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Process a hit of this hitobject. Carries out judgement.
|
||||
/// </summary>
|
||||
@ -119,7 +131,11 @@ namespace osu.Game.Modes.Objects.Drawables
|
||||
|
||||
protected virtual void CheckJudgement(bool userTriggered)
|
||||
{
|
||||
//todo: consider making abstract.
|
||||
if (NestedHitObjects != null)
|
||||
{
|
||||
foreach (var d in NestedHitObjects)
|
||||
d.CheckJudgement(userTriggered);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void UpdateAfterChildren()
|
||||
|
Reference in New Issue
Block a user