1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-17 22:17:25 +08:00

Add doc comments to HitObjectEntryManager

This commit is contained in:
ekrctb 2021-06-16 15:09:01 +09:00 committed by Dean Herbert
parent bde390828b
commit 47539e2129

View File

@ -19,13 +19,38 @@ namespace osu.Game.Rulesets.Objects.Pooling
/// </summary>
public IEnumerable<HitObjectLifetimeEntry> AllEntries => entryMap.Values;
/// <summary>
/// Invoked when a new <see cref="HitObjectLifetimeEntry"/> is added to this <see cref="HitObjectEntryManager"/>..
/// The second parameter of the event is the parent hit object.
/// </summary>
public event Action<HitObjectLifetimeEntry, HitObject?>? OnEntryAdded;
/// <summary>
/// Invoked when a <see cref="HitObjectLifetimeEntry"/> is removed from this <see cref="HitObjectEntryManager"/>.
/// The second parameter of the event is the parent hit object.
/// </summary>
public event Action<HitObjectLifetimeEntry, HitObject?>? OnEntryRemoved;
private readonly Func<HitObject, HitObjectLifetimeEntry> createLifetimeEntry;
/// <summary>
/// Provides the reverse mapping of <see cref="HitObjectLifetimeEntry.HitObject"/> for each entry.
/// </summary>
private readonly Dictionary<HitObject, HitObjectLifetimeEntry> entryMap = new Dictionary<HitObject, HitObjectLifetimeEntry>();
/// <summary>
/// Stores the parent hit object for entries of the nested hit objects.
/// A <c>null</c> is stored for entries of the top-level hit objects.
/// </summary>
/// <remarks>
/// The parent hit object of a pooled hit object may be non-pooled.
/// In that case, no corresponding <see cref="HitObjectLifetimeEntry"/> is stored in this <see cref="HitObjectEntryManager"/>.
/// </remarks>
private readonly Dictionary<HitObjectLifetimeEntry, HitObject?> parentMap = new Dictionary<HitObjectLifetimeEntry, HitObject?>();
/// <summary>
/// Stores the list of entries managed by this <see cref="HitObjectEntryManager"/> for each hit object managed by this <see cref="HitObjectEntryManager"/>.
/// </summary>
private readonly Dictionary<HitObject, List<HitObjectLifetimeEntry>> childrenMap = new Dictionary<HitObject, List<HitObjectLifetimeEntry>>();
public HitObjectEntryManager(Func<HitObject, HitObjectLifetimeEntry> createLifetimeEntry)