using System; using Syntriax.Engine.Core.Abstract; namespace Syntriax.Engine.Core; [System.Diagnostics.DebuggerDisplay("Position: {Position.ToString(), nq}, Scale: {Scale.ToString(), nq}, Rotation: {Rotation}")] public class Transform : ITransform { public Action? OnPositionChanged { get; set; } = null; public Action? OnScaleChanged { get; set; } = null; public Action? OnRotationChanged { get; set; } = null; private Vector2D _position = Vector2D.Zero; private Vector2D _scale = Vector2D.One; private float _rotation = 0f; public Vector2D Position { get => _position; set { if (value == _position) return; _position = value; OnPositionChanged?.Invoke(this); } } public Vector2D Scale { get => _scale; set { if (value == _scale) return; _scale = value; OnScaleChanged?.Invoke(this); } } public float Rotation { get => _rotation; set { if (value == _rotation) return; _rotation = value; OnRotationChanged?.Invoke(this); } } }