Readonly
statesThe enum associated with this structure.
Private
#valueThe real value behind the bitmask instance.
Private
#validThe structure of valid states and their associated values.
True if this bitmask is empty (no active states).
Toggle the state of a specific state in the bitmask.
The state to toggle.
Optional
enabled: booleanToggle on (true) or off (false)? If undefined, the state is switched automatically.
Throws an error if the provided state is not valid.
Checks if two bitmasks structures are compatible (the same valid states).
The bitmask structure to compare with.
True if the two bitmasks have the same structure, false otherwise.
Private
#generatePrivate
#generatePrivate
#computePrivate
#checkStatic
fromJSONStatic
generate
Create a new BitMask instance.
Param: states
An object containing valid states and their corresponding initial boolean values (default is null).