From 0670312cb708e1e3365a1913a5e2b526d9de640d Mon Sep 17 00:00:00 2001 From: Madpeter Date: Fri, 1 May 2020 23:24:18 +0100 Subject: [PATCH] Moves the statis function inbox to helpers. adds a new function inrange --- BSBshared/Staic/Helpers.cs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/BSBshared/Staic/Helpers.cs b/BSBshared/Staic/Helpers.cs index e2960f5..8feb701 100644 --- a/BSBshared/Staic/Helpers.cs +++ b/BSBshared/Staic/Helpers.cs @@ -22,6 +22,33 @@ namespace BetterSecondBotShared.Static } public static class helpers { + public static bool inrange(float current,float min,float max) + { + if(current <= max) + { + if(current >= min) + { + return true; + } + } + return false; + } + public static bool inbox(float expected, float current, float drift) + { + return distance_check(expected, current, drift, true); + } + public static bool distance_check(float expected, float current, float drift, bool current_value) + { + if (current > (expected + drift)) + { + return false; + } + else if (current < (expected - drift)) + { + return false; + } + return current_value; + } public static string GetSHA1(string text) { SHA1 hash = SHA1CryptoServiceProvider.Create();