Initial commit: AetherBags + KamiToolKit for FC Gitea
Debug Build and Test / Build against Latest Dalamud (push) Has been cancelled
Debug Build and Test / Build against Staging Dalamud (push) Has been cancelled

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-08 14:46:31 -05:00
commit 8db4ce6094
375 changed files with 34124 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
using System.Numerics;
namespace KamiToolKit.Classes;
public static class FlagHelper {
public static bool ReadFlag<T>(ref T flagsField, int flag) where T : struct, IBinaryInteger<T>
=> (flagsField & T.One << BitOperations.Log2((uint)flag)) != T.Zero;
public static void SetFlag<T>(ref T flagsField, int flag) where T : struct, IBinaryInteger<T>
=> flagsField |= T.One << BitOperations.Log2((uint)flag);
public static void ClearFlag<T>(ref T flagsField, int flag) where T : struct, IBinaryInteger<T>
=> flagsField &= ~(T.One << BitOperations.Log2((uint)flag));
public static void UpdateFlag<T>(ref T flagsField, int flag, bool enable) where T : struct, IBinaryInteger<T> {
if (enable) {
SetFlag(ref flagsField, flag);
}
else {
ClearFlag(ref flagsField, flag);
}
}
}