using System; using System.Collections.Generic; namespace Syntriax.Engine.Core.Abstract; /// /// Represents the transformation properties of an object such as position, scale, and rotation. /// public interface ITransform : IAssignableGameObject, IEnumerable { /// /// Event triggered when the of the changes. /// event OnPositionChangedDelegate? OnPositionChanged; /// /// Event triggered when the of the changes. /// event OnScaleChangedDelegate? OnScaleChanged; /// /// Event triggered when the of the changes. /// event OnRotationChangedDelegate? OnRotationChanged; /// /// Event triggered when the of the changes. The second parameter is the old . /// event OnParentChangedDelegate? OnParentChanged; /// /// Event triggered when a new is added to the . /// event OnChildrenAddedDelegate? OnChildrenAdded; /// /// Event triggered when an is removed from the . /// event OnChildrenRemovedDelegate? OnChildrenRemoved; /// /// The world position of the in 2D space. /// Vector2D Position { get; set; } /// /// The world scale of the . /// Vector2D Scale { get; set; } /// /// The world rotation of the in degrees. /// float Rotation { get; set; } /// /// The local position of the in 2D space. /// Vector2D LocalPosition { get; set; } /// /// The local scale of the . /// Vector2D LocalScale { get; set; } /// /// The local rotation of the in degrees. /// float LocalRotation { get; set; } /// /// The parent of the . /// ITransform? Parent { get; } /// /// The s that have this as their . /// IReadOnlyList Children { get; } /// /// Sets the parent of this . /// /// The parent to set. void SetParent(ITransform? transform); /// /// Adds a child to this . /// /// The child to add. void AddChild(ITransform transform); /// /// Removes a child from this . /// /// The child to remove. void RemoveChild(ITransform transform); delegate void OnPositionChangedDelegate(ITransform sender); delegate void OnScaleChangedDelegate(ITransform sender); delegate void OnRotationChangedDelegate(ITransform sender); delegate void OnParentChangedDelegate(ITransform sender, ITransform? previousParent, ITransform? newParent); delegate void OnChildrenAddedDelegate(ITransform sender, ITransform childrenAdded); delegate void OnChildrenRemovedDelegate(ITransform sender, ITransform childrenRemoved); }