mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Fix hitobjects with unknown lifetimes by enforcing non-null judgement
We've seen multiple cases where DrawableHitObject are stuck in the lifetime management container due to not implementing a judgement (meaning they are never "hit" or "missed"). To avoid this going forward CreateJudgement() must be implemented and return a non-null judgement. This fixes BananaShower and JuiceStreams in osu!catch. This also makes HitObject abstract and cleans up convert HitObject implementations.
This commit is contained in:
@ -22,7 +22,7 @@ namespace osu.Game.Rulesets.Objects
|
||||
/// HitObjects may contain more properties for which you should be checking through the IHas* types.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public class HitObject
|
||||
public abstract class HitObject
|
||||
{
|
||||
/// <summary>
|
||||
/// A small adjustment to the start time of control points to account for rounding/precision errors.
|
||||
@ -83,7 +83,7 @@ namespace osu.Game.Rulesets.Objects
|
||||
[JsonIgnore]
|
||||
public IReadOnlyList<HitObject> NestedHitObjects => nestedHitObjects;
|
||||
|
||||
public HitObject()
|
||||
protected HitObject()
|
||||
{
|
||||
StartTimeBindable.ValueChanged += time =>
|
||||
{
|
||||
@ -144,9 +144,10 @@ namespace osu.Game.Rulesets.Objects
|
||||
|
||||
/// <summary>
|
||||
/// Creates the <see cref="Judgement"/> that represents the scoring information for this <see cref="HitObject"/>.
|
||||
/// May be null.
|
||||
/// Used to decide on drawable object lifetimes.
|
||||
/// </summary>
|
||||
public virtual Judgement CreateJudgement() => null;
|
||||
[NotNull]
|
||||
public abstract Judgement CreateJudgement();
|
||||
|
||||
/// <summary>
|
||||
/// Creates the <see cref="HitWindows"/> for this <see cref="HitObject"/>.
|
||||
@ -156,7 +157,7 @@ namespace osu.Game.Rulesets.Objects
|
||||
/// </para>
|
||||
/// </summary>
|
||||
[NotNull]
|
||||
protected virtual HitWindows CreateHitWindows() => new HitWindows();
|
||||
protected abstract HitWindows CreateHitWindows();
|
||||
}
|
||||
|
||||
public static class HitObjectExtensions
|
||||
|
Reference in New Issue
Block a user