From 3817ebebfe3c3d328219656033f2518da6a59350 Mon Sep 17 00:00:00 2001 From: Syntriax Date: Tue, 30 Jan 2024 12:57:27 +0300 Subject: [PATCH] feat: Transform Extensions --- Engine.Core/Extensions/TransformExtensions.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Engine.Core/Extensions/TransformExtensions.cs 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; + } +}