using System.Collections.Generic;
namespace Syntriax.Engine.Core;
///
/// Represents a controller for managing s. Connected to an .
///
public interface IBehaviourController : IEntity, IHasUniverseObject
{
///
/// Event triggered when a is added to the .
///
Event OnBehaviourAdded { get; }
///
/// Event triggered when a is removed from the .
///
Event OnBehaviourRemoved { get; }
///
/// Amount of collected.
///
int Count { get; }
///
/// Get a collected by it's index.
///
IBehaviour this[System.Index index] { get; }
///
/// Adds a to the .
///
/// The type of to add.
/// The to add.
/// The added .
T AddBehaviour(T behaviour) where T : class, IBehaviour;
///
/// Adds a of the specified type to the .
///
/// The type of to add.
/// Construction parameters for the .
/// The added .
T AddBehaviour(params object?[]? args) where T : class, IBehaviour;
///
/// Gets a of the specified type.
///
/// The type of to get.
/// The of the specified type if found; otherwise, .
T? GetBehaviour();
///
/// Gets all s of the specified type.
///
/// The type of s to get.
/// A list of s of the specified type.
IReadOnlyList GetBehaviours();
///
/// Gets all s of the specified type and stores them in the provided list.
///
/// The type of s to get.
/// The list to store the s.
void GetBehaviours(IList results);
///
/// Removes s of the specified type from the .
///
/// The type of s to remove.
/// A flag indicating whether to remove all s of the specified type.
void RemoveBehaviour(bool removeAll = false) where T : class, IBehaviour;
///
/// Removes the specified from the .
///
/// The type of to remove.
/// The to remove.
void RemoveBehaviour(T behaviour) where T : class, IBehaviour;
delegate void BehaviourAddedEventHandler(IBehaviourController sender, IBehaviour behaviourAdded);
delegate void BehaviourRemovedEventHandler(IBehaviourController sender, IBehaviour behaviourRemoved);
}