Class BitwiseExtensions
- Namespace
- Exiled.API.Extensions
- Assembly
- Exiled.API.dll
Extensions for bitwise operations.
public static class BitwiseExtensions
- Inheritance
-
BitwiseExtensions
- Inherited Members
Methods
AddFlags<T>(T, params T[])
Adds the specified flags to the given enum value.
public static T AddFlags<T>(this T flags, params T[] newFlags) where T : Enum
Parameters
flags
TThe enum value to add flags to.
newFlags
T[]The flags to add.
Returns
- T
The enum value with the specified flags added.
Type Parameters
T
The type of the enum.
HasFlagFast<T>(T, T)
Checks if flag has specified value.
public static bool HasFlagFast<T>(this T flag, T value) where T : Enum
Parameters
flag
TFlag to check.
value
TValue to check in flag.
Returns
Type Parameters
T
The type of the enum.
ModifyFlags<T>(T, bool, params T[])
Sets the specified flag to the given value, default is true.
public static T ModifyFlags<T>(this T flags, bool value, params T[] changeFlags) where T : Enum
Parameters
flags
TThe flags enum to modify.
value
boolThe value to set the flag to.
changeFlags
T[]The flags to modify.
Returns
- T
The flags enum with the flag set to the given value.
Type Parameters
T
The type of the enum.
RemoveFlags<T>(T, params T[])
Removes the specified flags from the given enum value.
public static T RemoveFlags<T>(this T flags, params T[] oldFlags) where T : Enum
Parameters
flags
TThe enum value to remove flags from.
oldFlags
T[]The flags to remove.
Returns
- T
The enum value with the specified flags removed.
Type Parameters
T
The type of the enum.