Table of Contents

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 T

The 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 T

Flag to check.

value T

Value to check in flag.

Returns

bool

true if value is presented in flag. Otherwise, false.

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 T

The flags enum to modify.

value bool

The 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 T

The 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.