refactor: IHierarchy Integration with Overall Code Base

This commit is contained in:
2024-10-26 13:46:04 +03:00
parent 62e50aefc1
commit 43f1749b04
5 changed files with 69 additions and 41 deletions

View File

@@ -5,7 +5,7 @@ namespace Syntriax.Engine.Core.Abstract;
/// This interface allows for tracking the object's presence in the hierarchy and provides events
/// for notifying when the see enters or exits the hierarchy.
/// </summary>
public interface IHierarchyObject : IEntity
public interface IHierarchyObject : IEntity, INameable
{
/// <summary>
/// Event triggered when the <see cref="IEntity"/> enters the hierarchy.

View File

@@ -48,10 +48,10 @@ public interface IGameManager : IEntity, IEnumerable<IGameObject>
IReadOnlyList<IHierarchyObject> HierarchyObjects { get; }
/// <summary>
/// Registers a <see cref="IGameObject"/> to the <see cref="IGameManager"/>.
/// Registers an <see cref="IHierarchyObject"/> to the <see cref="IGameManager"/>.
/// </summary>
/// <param name="gameObject">The <see cref="IGameObject"/> to register.</param>
void RegisterGameObject(IGameObject gameObject);
/// <param name="hierarchyObject">The <see cref="IHierarchyObject"/> to register.</param>
void Register(IHierarchyObject hierarchyObject);
/// <summary>
/// Instantiates a <see cref="IGameObject"/> of type T with the given arguments and registers it to the <see cref="IGameManager"/>.
@@ -62,11 +62,10 @@ public interface IGameManager : IEntity, IEnumerable<IGameObject>
T InstantiateGameObject<T>(params object?[]? args) where T : class, IGameObject;
/// <summary>
/// Removes a <see cref="IGameObject"/> from the <see cref="IGameManager"/>.
/// Removes an <see cref="IHierarchyObject"/> from the <see cref="IGameManager"/>.
/// </summary>
/// <param name="gameObject">The <see cref="IGameObject"/> to remove.</param>
/// <returns>The removed <see cref="IGameObject"/>.</returns>
IGameObject RemoveGameObject(IGameObject gameObject);
/// <param name="hierarchyObject">The <see cref="IHierarchyObject"/> to remove.</param>
void Remove(IHierarchyObject hierarchyObject);
/// <summary>
/// Updates the <see cref="IGameManager"/> with the given engine time data.