namespace Syntriax.Engine.Core.Abstract;
///
/// Represents an that can enter and exit a hierarchy within the system.
/// 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.
///
public interface IHierarchyObject : IEntity, INameable
{
///
/// Event triggered when the enters the hierarchy.
///
event OnEnteredHierarchyDelegate? OnEnteredHierarchy;
///
/// Event triggered when the exits the hierarchy.
///
event OnExitedHierarchyDelegate? OnExitedHierarchy;
///
/// Gets the associated with this , if any.
///
IGameManager? GameManager { get; }
///
/// Indicates whether the is currently in the hierarchy.
///
bool IsInHierarchy { get; }
///
/// Internal method to handle entering the hierarchy.
/// This should be called by the system to properly manage hierarchy states.
///
/// The game manager that is managing this hierarchy.
///
/// if the successfully entered the hierarchy;
/// if it failed to do so.
///
internal bool EnterHierarchy(IGameManager gameManager);
///
/// Internal method to handle exiting the hierarchy.
/// This should be called by the system to properly manage hierarchy states.
///
///
/// if the successfully exited the hierarchy;
/// if it failed to do so.
///
internal bool ExitHierarchy();
///
/// Delegate type for the event triggered when the enters the hierarchy.
///
/// The that entered the hierarchy.
delegate void OnEnteredHierarchyDelegate(IHierarchyObject sender);
///
/// Delegate type for the event triggered when the exits the hierarchy.
///
/// The that exited the hierarchy.
delegate void OnExitedHierarchyDelegate(IHierarchyObject sender);
}