From b7932ab07f49365b8c8aec87c8d404cc6c38dd33 Mon Sep 17 00:00:00 2001 From: Xenira <1288524+Xenira@users.noreply.github.com> Date: Wed, 6 Mar 2024 23:24:14 +0100 Subject: [PATCH] refactor(util): change bitstate to not be static (#20) --- plugin/src/util/BitState.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/plugin/src/util/BitState.cs b/plugin/src/util/BitState.cs index 2108d9b..1036f72 100644 --- a/plugin/src/util/BitState.cs +++ b/plugin/src/util/BitState.cs @@ -2,49 +2,49 @@ namespace PiUtils.Input; public class BitState { - public static long state = 0; - private static long initialState = 0; + public long state = 0; + private long initialState = 0; - private static long nextNewFlag = 1; + private long nextNewFlag = 1; - public static long GetNextFlag() + public long GetNextFlag() { var result = nextNewFlag; nextNewFlag <<= 1; return result; } - internal static void reset() + internal void reset() { state = initialState; } - public static void setState(long newState) + public void setState(long newState) { state = newState; } - public static void addState(long newState) + public void addState(long newState) { state |= newState; } - public static void removeState(long newState) + public void removeState(long newState) { state &= ~newState; } - public static void toggleState(long newState) + public void toggleState(long newState) { state ^= newState; } - public static bool hasState(long newState) + public bool hasState(long newState) { return (state & newState) != 0; } - public static bool hasAnyState(long newState) + public bool hasAnyState(long newState) { return (state & newState) != 0; }