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 called on the . /// event OnUpdateDelegate? OnUpdate; /// /// Event triggered when is called on the . /// event OnPreDawDelegate? OnPreDraw; /// /// Event triggered when a is registered to the . /// event OnGameObjectRegisteredDelegate? OnGameObjectRegistered; /// /// Event triggered when a is unregistered from the . /// event OnGameObjectUnRegisteredDelegate? OnGameObjectUnRegistered; /// /// Event triggered when a is registered to the . /// event OnHierarchyObjectRegisteredDelegate? OnHierarchyObjectRegistered; /// /// Event triggered when a is unregistered from the . /// event OnHierarchyObjectUnRegisteredDelegate? OnHierarchyObjectUnRegistered; /// /// Gets a read-only list of s managed by the . /// IReadOnlyList GameObjects { get; } /// /// Gets a read-only list of s managed by the . /// IReadOnlyList HierarchyObjects { get; } /// /// Registers a to the . /// /// The to register. void RegisterGameObject(IGameObject gameObject); /// /// 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 InstantiateGameObject(params object?[]? args) where T : class, IGameObject; /// /// Removes a from the . /// /// The to remove. /// The removed . IGameObject RemoveGameObject(IGameObject gameObject); /// /// Updates the with the given engine time data. /// /// The engine time. void Update(EngineTime time); /// /// Performs operations that should be done before the draw calls. /// void PreDraw(); delegate void OnUpdateDelegate(IGameManager sender, EngineTime time); delegate void OnPreDawDelegate(IGameManager sender); delegate void OnGameObjectRegisteredDelegate(IGameManager sender, IGameObject gameObjectRegistered); delegate void OnGameObjectUnRegisteredDelegate(IGameManager sender, IGameObject gameObjectUnregistered); delegate void OnHierarchyObjectRegisteredDelegate(IGameManager sender, IHierarchyObject hierarchyObjectRegistered); delegate void OnHierarchyObjectUnRegisteredDelegate(IGameManager sender, IHierarchyObject hierarchyObjectUnregistered); }