using System.Collections.Generic;
namespace Syntriax.Engine.Core.Abstract;
///
/// Represents a controller for managing s and notify them accordingly about the engine's updates. Connected to an .
///
public interface IBehaviourController : IInitializable, IHasHierarchyObject, IEnumerable
{
///
/// Event triggered before the update of s.
///
event PreUpdateEventHandler? OnPreUpdate;
///
/// Event triggered during the update of s.
///
event UpdateEventHandler? OnUpdate;
///
/// Event triggered before the drawing phase.
///
event PreDrawEventHandler? OnPreDraw;
///
/// Event triggered when a is added to the .
///
event BehaviourAddedEventHandler? OnBehaviourAdded;
///
/// Event triggered when a is removed from the .
///
event BehaviourRemovedEventHandler? OnBehaviourRemoved;
///
/// 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.
IList 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;
///
/// Updates all s in the .
///
void Update();
///
/// Performs pre-draw operations.
///
void UpdatePreDraw();
delegate void PreUpdateEventHandler(IBehaviourController sender);
delegate void UpdateEventHandler(IBehaviourController sender);
delegate void PreDrawEventHandler(IBehaviourController sender);
delegate void BehaviourAddedEventHandler(IBehaviourController sender, IBehaviour behaviourAdded);
delegate void BehaviourRemovedEventHandler(IBehaviourController sender, IBehaviour behaviourRemoved);
}