mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 04:13:00 +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>
|
||||
/// Whether the initialization logic in <see cref="Playfield" /> has applied.
|
||||
/// </summary>
|
||||
internal bool HasInitialized;
|
||||
internal bool IsInitialized;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="DrawableHitObject"/>.
|
||||
|
@ -120,8 +120,8 @@ namespace osu.Game.Rulesets.UI
|
||||
|
||||
OnNewDrawableHitObject(d);
|
||||
|
||||
Debug.Assert(!d.HasInitialized);
|
||||
d.HasInitialized = true;
|
||||
Debug.Assert(!d.IsInitialized);
|
||||
d.IsInitialized = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -135,8 +135,8 @@ namespace osu.Game.Rulesets.UI
|
||||
/// <param name="h">The DrawableHitObject to add.</param>
|
||||
public virtual void Add(DrawableHitObject h)
|
||||
{
|
||||
if (h.HasInitialized)
|
||||
throw new InvalidOperationException($"{nameof(Playfield.Add)} doesn't support {nameof(DrawableHitObject)} reuse. Use pooling instead.");
|
||||
if (h.IsInitialized)
|
||||
throw new InvalidOperationException($"{nameof(Add)} doesn't support {nameof(DrawableHitObject)} reuse. Use pooling instead.");
|
||||
|
||||
onNewDrawableHitObject(h);
|
||||
|
||||
@ -175,7 +175,7 @@ namespace osu.Game.Rulesets.UI
|
||||
|
||||
/// <summary>
|
||||
/// 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>
|
||||
/// <remarks>
|
||||
/// This is also invoked for nested <see cref="DrawableHitObject"/>s.
|
||||
@ -348,7 +348,7 @@ namespace osu.Game.Rulesets.UI
|
||||
{
|
||||
var dho = (DrawableHitObject)d;
|
||||
|
||||
if (!dho.HasInitialized)
|
||||
if (!dho.IsInitialized)
|
||||
{
|
||||
onNewDrawableHitObject(dho);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user