using System.Collections.Generic; namespace Syntriax.Engine.Core.Abstract; /// /// Represents a game world responsible for managing s. /// public interface IGameManager : IEntity { /// /// Event triggered when is called on the . /// event OnUpdateEventHandler? OnUpdate; /// /// Event triggered when is called on the . /// event OnPreDawEventHandler? OnPreDraw; /// /// Event triggered when a is registered to the . /// event OnGameObjectRegisteredEventHandler? OnGameObjectRegistered; /// /// Event triggered when a is unregistered from the . /// event OnGameObjectUnRegisteredEventHandler? OnGameObjectUnRegistered; /// /// Event triggered when a is registered to the . /// event OnHierarchyObjectRegisteredEventHandler? OnHierarchyObjectRegistered; /// /// Event triggered when a is unregistered from the . /// event OnHierarchyObjectUnRegisteredEventHandler? 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 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 InstantiateGameObject(params object?[]? args) where T : class, IGameObject; /// /// Removes an from the . /// /// The to remove. void Remove(IHierarchyObject hierarchyObject); /// /// 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 OnUpdateEventHandler(IGameManager sender, EngineTime time); delegate void OnPreDawEventHandler(IGameManager sender); delegate void OnGameObjectRegisteredEventHandler(IGameManager sender, IGameObject gameObjectRegistered); delegate void OnGameObjectUnRegisteredEventHandler(IGameManager sender, IGameObject gameObjectUnregistered); delegate void OnHierarchyObjectRegisteredEventHandler(IGameManager sender, IHierarchyObject hierarchyObjectRegistered); delegate void OnHierarchyObjectUnRegisteredEventHandler(IGameManager sender, IHierarchyObject hierarchyObjectUnregistered); }