using System.Collections.Generic;
namespace Syntriax.Engine.Core.Abstract;
///
/// Represents a game world responsible for managing s.
///
public interface IGameManager : IEntity, IEnumerable
{
///
/// Event triggered when is about to be called called on the .
///
event UpdateEventHandler? OnPreUpdate;
///
/// Event triggered when is called on the .
///
event UpdateEventHandler? OnUpdate;
///
/// Event triggered when is called on the .
///
event PreDrawEventHandler? OnPreDraw;
///
/// Event triggered when a is registered to the .
///
event HierarchyObjectRegisteredEventHandler? OnHierarchyObjectRegistered;
///
/// Event triggered when a is unregistered from the .
///
event HierarchyObjectUnRegisteredEventHandler? OnHierarchyObjectUnRegistered;
///
/// Current time scale the operates on.
///
float TimeScale { get; set; }
///
/// Contains time data related to this .
///
EngineTime Time { get; }
///
/// Contains unscaled time data related to this .
///
EngineTime UnscaledTime { get; }
///
/// Gets a read-only list of s managed by the .
///
IReadOnlyList HierarchyObjects { get; }
///
/// Registers an to the .
///
/// The to register.
void Register(IHierarchyObject hierarchyObject);
///
/// Instantiates a of type T with the given arguments and registers it to the .
///
/// The type of to instantiate.
/// Constructor parameters for the given type of .
/// The instantiated .
T InstantiateHierarchyObject(params object?[]? args) where T : class, IHierarchyObject;
///
/// Removes an from the .
///
/// The to remove.
void Remove(IHierarchyObject hierarchyObject);
///
/// Updates the with the given delta time.
///
/// Delta time.
void Update(EngineTime engineTime);
///
/// Performs operations that should be done before the draw calls.
///
void PreDraw();
delegate void UpdateEventHandler(IGameManager sender, EngineTime engineTime);
delegate void PreDrawEventHandler(IGameManager sender);
delegate void HierarchyObjectRegisteredEventHandler(IGameManager sender, IHierarchyObject hierarchyObjectRegistered);
delegate void HierarchyObjectUnRegisteredEventHandler(IGameManager sender, IHierarchyObject hierarchyObjectUnregistered);
}