diff --git a/Engine.Core/Extensions/TransformExtensions.cs b/Engine.Core/Extensions/TransformExtensions.cs new file mode 100644 index 0000000..6925554 --- /dev/null +++ b/Engine.Core/Extensions/TransformExtensions.cs @@ -0,0 +1,14 @@ +using Syntriax.Engine.Core.Abstract; + +namespace Syntriax.Engine.Core; + +public static class TransformExtensions +{ + public static ITransform SetTransform(this ITransform transform, Vector2D? position = null, float? rotation = null, Vector2D? scale = null) + { + if (position.HasValue) transform.Position = position.Value; + if (rotation.HasValue) transform.Rotation = rotation.Value; + if (scale.HasValue) transform.Scale = scale.Value; + return transform; + } +}