mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Small refactorings
This commit is contained in:
@ -233,6 +233,13 @@ namespace osu.Game.Rulesets.UI
|
|||||||
ResumeOverlay?.Hide();
|
ResumeOverlay?.Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds a <see cref="HitObject"/> to this <see cref="DrawableRuleset"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This does not add the <see cref="HitObject"/> to the beatmap.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="hitObject">The <see cref="HitObject"/> to add.</param>
|
||||||
public void AddHitObject(TObject hitObject)
|
public void AddHitObject(TObject hitObject)
|
||||||
{
|
{
|
||||||
if (PoolHitObjects)
|
if (PoolHitObjects)
|
||||||
@ -241,6 +248,13 @@ namespace osu.Game.Rulesets.UI
|
|||||||
Playfield.Add(CreateDrawableRepresentation(hitObject));
|
Playfield.Add(CreateDrawableRepresentation(hitObject));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Removes a <see cref="HitObject"/> from this <see cref="HitObject"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This does not remove the <see cref="HitObject"/> from the beatmap.
|
||||||
|
/// </remarks>
|
||||||
|
/// <param name="hitObject">The <see cref="HitObject"/> to remove.</param>
|
||||||
public void RemoveHitObject(TObject hitObject)
|
public void RemoveHitObject(TObject hitObject)
|
||||||
{
|
{
|
||||||
if (PoolHitObjects)
|
if (PoolHitObjects)
|
||||||
@ -380,7 +394,6 @@ namespace osu.Game.Rulesets.UI
|
|||||||
/// Displays an interactive ruleset gameplay instance.
|
/// Displays an interactive ruleset gameplay instance.
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// This type is required only for adding non-generic type to the draw hierarchy.
|
/// This type is required only for adding non-generic type to the draw hierarchy.
|
||||||
/// Once IDrawable is a thing, this can also become an interface.
|
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Cached(typeof(DrawableRuleset))]
|
[Cached(typeof(DrawableRuleset))]
|
||||||
|
@ -100,10 +100,11 @@ namespace osu.Game.Rulesets.UI
|
|||||||
public virtual void Add(DrawableHitObject hitObject)
|
public virtual void Add(DrawableHitObject hitObject)
|
||||||
{
|
{
|
||||||
bindStartTime(hitObject);
|
bindStartTime(hitObject);
|
||||||
AddInternal(hitObject);
|
|
||||||
|
|
||||||
hitObject.OnNewResult += onNewResult;
|
hitObject.OnNewResult += onNewResult;
|
||||||
hitObject.OnRevertResult += onRevertResult;
|
hitObject.OnRevertResult += onRevertResult;
|
||||||
|
|
||||||
|
AddInternal(hitObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool Remove(DrawableHitObject hitObject)
|
public virtual bool Remove(DrawableHitObject hitObject)
|
||||||
@ -143,7 +144,12 @@ namespace osu.Game.Rulesets.UI
|
|||||||
unbindAllStartTimes();
|
unbindAllStartTimes();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool CheckChildrenLife() => base.CheckChildrenLife() | lifetimeManager.Update(Time.Current, Time.Current);
|
protected override bool CheckChildrenLife()
|
||||||
|
{
|
||||||
|
bool aliveChanged = base.CheckChildrenLife();
|
||||||
|
aliveChanged |= lifetimeManager.Update(Time.Current, Time.Current);
|
||||||
|
return aliveChanged;
|
||||||
|
}
|
||||||
|
|
||||||
private void onNewResult(DrawableHitObject d, JudgementResult r) => NewResult?.Invoke(d, r);
|
private void onNewResult(DrawableHitObject d, JudgementResult r) => NewResult?.Invoke(d, r);
|
||||||
private void onRevertResult(DrawableHitObject d, JudgementResult r) => RevertResult?.Invoke(d, r);
|
private void onRevertResult(DrawableHitObject d, JudgementResult r) => RevertResult?.Invoke(d, r);
|
||||||
|
Reference in New Issue
Block a user