refactor: behaviour collector Count and indexer accessors added

This commit is contained in:
2025-05-29 23:16:10 +03:00
parent 67d7f401b8
commit b0f8b0dad6
6 changed files with 44 additions and 34 deletions

View File

@@ -1,5 +1,3 @@
using System.Collections.Generic;
namespace Syntriax.Engine.Core;
/// <summary>
@@ -19,6 +17,16 @@ public interface IBehaviourCollector<T> : IHasUniverse where T : class
/// </summary>
event RemovedEventHandler? OnRemoved;
/// <summary>
/// Amount of <typeparamref name="T"/> collected.
/// </summary>
int Count { get; }
/// <summary>
/// Get a <typeparamref name="T"/> collected by it's index.
/// </summary>
T this[System.Index index] { get; }
/// <summary>
/// Delegate for handling the <see cref="OnCollected"/> event.
/// </summary>