using System.Collections.Generic;
namespace Engine.Core;
/// 
/// Represents an  that can enter and exit a universe within the  system.
/// This interface allows for tracking the object's presence in the universe and provides events 
/// for notifying when the see enters or exits the universe.
/// 
public interface IUniverseObject : IEntity, IActive, INameable, IHasBehaviourController
{
    /// 
    /// Event triggered when the  enters the universe.
    /// 
    Event OnEnteredUniverse { get; }
    /// 
    /// Event triggered when the  exits the universe.
    /// 
    Event OnExitedUniverse { get; }
    /// 
    /// Event triggered when the  of the  changes. The second parameter is the old .
    /// 
    Event OnParentChanged { get; }
    /// 
    /// Event triggered when a new  is added to the .
    /// 
    Event OnChildrenAdded { get; }
    /// 
    /// Event triggered when an  is removed from the .
    /// 
    Event OnChildrenRemoved { get; }
    /// 
    /// Gets the  this  is connected to, if any.
    /// 
    IUniverse Universe { get; }
    /// 
    /// Indicates whether the  is currently in the universe.
    /// 
    bool IsInUniverse { get; }
    /// 
    /// The parent  of the .
    /// 
    IUniverseObject? Parent { get; set; }
    /// 
    /// The s that have this  as their .
    /// 
    IReadOnlyList Children { get; }
    /// 
    /// Internal method to handle entering the universe.
    /// This should be called by the system to properly manage universe states.
    /// 
    /// The  that is managing this universe.
    /// 
    ///  if the  successfully entered the universe; 
    ///  if it failed to do so.
    /// 
    internal bool EnterUniverse(IUniverse universe);
    /// 
    /// Internal method to handle exiting the universe.
    /// This should be called by the system to properly manage universe states.
    /// 
    /// 
    ///  if the  successfully exited the universe; 
    ///  if it failed to do so.
    /// 
    internal bool ExitUniverse();
    /// 
    /// Adds a child  to this .
    /// 
    /// The child  to add.
    void AddChild(IUniverseObject universeObject);
    /// 
    /// Removes a child  from this .
    /// 
    /// The child  to remove.
    void RemoveChild(IUniverseObject universeObject);
    /// 
    /// Arguments for the event triggered when the  enters the universe of a .
    /// 
    /// The  that entered the universe.
    /// The  that the  has entered it's universe.
    readonly record struct EnteredUniverseArguments(IUniverse Universe);
    /// 
    /// Arguments for the event triggered when the  exits the universe of a .
    /// 
    /// The  that exited the universe.
    /// The  that the  has exited it's universe.
    readonly record struct ExitedUniverseArguments(IUniverse Universe);
    /// 
    /// Arguments for the event triggered when the 's parent changes.
    /// 
    /// The  that the parent has changed.
    /// The previous  the sender was a child of.
    /// The new and current  the sender is a child of.
    readonly record struct ParentChangedArguments(IUniverseObject? PreviousParent, IUniverseObject? CurrentParent);
    /// 
    /// Arguments for the event triggered when a new  added as a child.
    /// 
    /// The parent  this event is being called from.
    /// The  that got removed as a children of the sender .
    readonly record struct ChildrenAddedArguments(IUniverseObject ChildrenAdded);
    /// 
    /// Delegate for the event triggered when a new  removed from being a child.
    /// 
    /// The parent  this event is being called from.
    /// The  that got removed as a children of the sender .
    readonly record struct ChildrenRemovedArguments(IUniverseObject ChildrenRemoved);
}