perf!: behaviour controller memory allocation issues fixed by removing the enumerable interface

This commit is contained in:
2025-05-30 12:12:27 +03:00
parent b0f8b0dad6
commit b1b5af94d3
4 changed files with 21 additions and 12 deletions

View File

@@ -5,7 +5,7 @@ namespace Syntriax.Engine.Core;
/// <summary>
/// Represents a controller for managing <see cref="IBehaviour"/>s. Connected to an <see cref="IUniverseObject"/>.
/// </summary>
public interface IBehaviourController : IEntity, IHasUniverseObject, IEnumerable<IBehaviour>
public interface IBehaviourController : IEntity, IHasUniverseObject
{
/// <summary>
/// Event triggered when a <see cref="IBehaviour"/> is added to the <see cref="IBehaviourController"/>.
@@ -17,6 +17,16 @@ public interface IBehaviourController : IEntity, IHasUniverseObject, IEnumerable
/// </summary>
event BehaviourRemovedEventHandler? OnBehaviourRemoved;
/// <summary>
/// Amount of <see cref="IBehaviour"/> collected.
/// </summary>
int Count { get; }
/// <summary>
/// Get a <see cref="IBehaviour"/> collected by it's index.
/// </summary>
IBehaviour this[System.Index index] { get; }
/// <summary>
/// Adds a <see cref="IBehaviour"/> to the <see cref="IBehaviourController"/>.
/// </summary>