From 12b430ba59aefb0f7215d75a26b7ea82e35cc2c0 Mon Sep 17 00:00:00 2001 From: louis1706 Date: Fri, 8 Sep 2023 02:19:37 +0200 Subject: [PATCH 1/4] AnimationCurve --- Exiled.API/Extensions/CommonExtensions.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Exiled.API/Extensions/CommonExtensions.cs b/Exiled.API/Extensions/CommonExtensions.cs index d505e006d2..e718a63090 100644 --- a/Exiled.API/Extensions/CommonExtensions.cs +++ b/Exiled.API/Extensions/CommonExtensions.cs @@ -33,5 +33,21 @@ public static class CommonExtensions /// The condition to require. /// Returns a random value from . public static T GetRandomValue(this IEnumerable enumerable, System.Func condition) => enumerable is null || enumerable.Count() == 0 ? default : enumerable.Where(condition).GetRandomValue(); + + public static AnimationCurve Multiply(this AnimationCurve curve, float amount) + { + for (var i = 0; i < curve.length; i++) + curve.keys[i].value *= amount; + + return curve; + } + + public static AnimationCurve Add(this AnimationCurve curve, float amount) + { + for (var i = 0; i < curve.length; i++) + curve.keys[i].value += amount; + + return curve; + } } } \ No newline at end of file From 97e7523ded47a097e079f2d4fdf4229991195546 Mon Sep 17 00:00:00 2001 From: louis1706 Date: Fri, 8 Sep 2023 10:12:52 +0200 Subject: [PATCH 2/4] Bad documentation --- Exiled.API/Extensions/CommonExtensions.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Exiled.API/Extensions/CommonExtensions.cs b/Exiled.API/Extensions/CommonExtensions.cs index e718a63090..8b49efc4c6 100644 --- a/Exiled.API/Extensions/CommonExtensions.cs +++ b/Exiled.API/Extensions/CommonExtensions.cs @@ -34,6 +34,12 @@ public static class CommonExtensions /// Returns a random value from . public static T GetRandomValue(this IEnumerable enumerable, System.Func condition) => enumerable is null || enumerable.Count() == 0 ? default : enumerable.Where(condition).GetRandomValue(); + /// + /// Will modify the curve with the amount used. + /// + /// The AnimationCurve to mofify. + /// The multiplier number. + /// The new modfied curve. public static AnimationCurve Multiply(this AnimationCurve curve, float amount) { for (var i = 0; i < curve.length; i++) @@ -42,6 +48,12 @@ public static AnimationCurve Multiply(this AnimationCurve curve, float amount) return curve; } + /// + /// Will modify the curve with the amount used. + /// + /// The AnimationCurve to mofify. + /// The add number. + /// The new modfied curve. public static AnimationCurve Add(this AnimationCurve curve, float amount) { for (var i = 0; i < curve.length; i++) From b8d4e7c4d9307b731bbc15636b9a0919945ec6aa Mon Sep 17 00:00:00 2001 From: louis1706 Date: Fri, 8 Sep 2023 10:19:56 +0200 Subject: [PATCH 3/4] Removing 'Exiled.Updater', --- build.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/build.ps1 b/build.ps1 index e2f1bc5f5b..2b4f5a54c8 100644 --- a/build.ps1 +++ b/build.ps1 @@ -9,7 +9,6 @@ $Projects = @( 'Exiled.API', 'Exiled.Permissions', 'Exiled.Events', - 'Exiled.Updater', 'Exiled.CreditTags', 'Exiled.Example', 'Exiled.CustomItems', From 9d5671e572410cb4971143df909bd5d282584a20 Mon Sep 17 00:00:00 2001 From: louis1706 Date: Fri, 8 Sep 2023 10:20:36 +0200 Subject: [PATCH 4/4] Revert "Removing 'Exiled.Updater'," This reverts commit b8d4e7c4d9307b731bbc15636b9a0919945ec6aa. --- build.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/build.ps1 b/build.ps1 index 2b4f5a54c8..e2f1bc5f5b 100644 --- a/build.ps1 +++ b/build.ps1 @@ -9,6 +9,7 @@ $Projects = @( 'Exiled.API', 'Exiled.Permissions', 'Exiled.Events', + 'Exiled.Updater', 'Exiled.CreditTags', 'Exiled.Example', 'Exiled.CustomItems',