mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 09:42:54 +08:00
Address @bdach's minor suggestions
This commit is contained in:
parent
c506b438bf
commit
666112cb5a
@ -149,7 +149,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the initialization logic in <see cref="Playfield" /> has applied.
|
/// Whether the initialization logic in <see cref="Playfield" /> has applied.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal bool HasInitialized;
|
internal bool IsInitialized;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new <see cref="DrawableHitObject"/>.
|
/// Creates a new <see cref="DrawableHitObject"/>.
|
||||||
|
@ -120,8 +120,8 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
OnNewDrawableHitObject(d);
|
OnNewDrawableHitObject(d);
|
||||||
|
|
||||||
Debug.Assert(!d.HasInitialized);
|
Debug.Assert(!d.IsInitialized);
|
||||||
d.HasInitialized = true;
|
d.IsInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -135,8 +135,8 @@ namespace osu.Game.Rulesets.UI
|
|||||||
/// <param name="h">The DrawableHitObject to add.</param>
|
/// <param name="h">The DrawableHitObject to add.</param>
|
||||||
public virtual void Add(DrawableHitObject h)
|
public virtual void Add(DrawableHitObject h)
|
||||||
{
|
{
|
||||||
if (h.HasInitialized)
|
if (h.IsInitialized)
|
||||||
throw new InvalidOperationException($"{nameof(Playfield.Add)} doesn't support {nameof(DrawableHitObject)} reuse. Use pooling instead.");
|
throw new InvalidOperationException($"{nameof(Add)} doesn't support {nameof(DrawableHitObject)} reuse. Use pooling instead.");
|
||||||
|
|
||||||
onNewDrawableHitObject(h);
|
onNewDrawableHitObject(h);
|
||||||
|
|
||||||
@ -175,7 +175,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Invoked before a new <see cref="DrawableHitObject"/> is added to this <see cref="Playfield"/>.
|
/// Invoked before a new <see cref="DrawableHitObject"/> is added to this <see cref="Playfield"/>.
|
||||||
/// It is invoked only once even the drawable is pooled and used multiple times for different <see cref="HitObject"/>s.
|
/// It is invoked only once even if the drawable is pooled and used multiple times for different <see cref="HitObject"/>s.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// This is also invoked for nested <see cref="DrawableHitObject"/>s.
|
/// This is also invoked for nested <see cref="DrawableHitObject"/>s.
|
||||||
@ -348,7 +348,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
{
|
{
|
||||||
var dho = (DrawableHitObject)d;
|
var dho = (DrawableHitObject)d;
|
||||||
|
|
||||||
if (!dho.HasInitialized)
|
if (!dho.IsInitialized)
|
||||||
{
|
{
|
||||||
onNewDrawableHitObject(dho);
|
onNewDrawableHitObject(dho);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user