Class: MockFlags32
Mock of the X-Ray engine flags32 bit-flags object.
Implements
flags32
Constructors
Constructor
new MockFlags32(): MockFlags32;Returns
MockFlags32
Methods
and()
Call Signature
and(source: flags32, mask: number): MockFlags32;Replace this mask with source & mask.
Parameters
| Parameter | Type | Description |
|---|---|---|
source | flags32 | Source mask. |
mask | number | Bits to keep. |
Returns
MockFlags32
This mask.
Implementation of
flags32.andCall Signature
and(mask: number): MockFlags32;Apply bitwise AND to this mask.
Parameters
| Parameter | Type | Description |
|---|---|---|
mask | number | Bits to keep. |
Returns
MockFlags32
This mask.
Implementation of
flags32.andassign()
assign(value: number | flags32): MockFlags32;Copy another flag mask.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | number | flags32 | Source mask. |
Returns
MockFlags32
This mask.
Implementation of
flags32.assignequal()
equal(value: Readonly<flags32>, mask?: number): boolean;Compare this mask with another mask.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | Readonly<flags32> | Mask to compare. |
mask? | number | - |
Returns
boolean
Whether masks are equal.
Implementation of
flags32.equalget()
get(): number;Get raw mask value.
Returns
number
Raw mask value.
Implementation of
flags32.getinvert()
invert(value?: number | flags32): MockFlags32;Invert all bits in this mask.
Parameters
| Parameter | Type |
|---|---|
value? | number | flags32 |
Returns
MockFlags32
This mask.
Implementation of
flags32.invertis()
Call Signature
is(value: flags32, mask: number): boolean;Check whether all selected bits are set in a source mask.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | flags32 | Source mask. |
mask | number | Bits to test. |
Returns
boolean
Whether all bits are set.
Remarks
This is stricter than is_any() and test(): every bit from mask must be present.
Implementation of
flags32.isCall Signature
is(mask: number): boolean;Check whether all selected bits are set in this mask.
Parameters
| Parameter | Type | Description |
|---|---|---|
mask | number | Bits to test. |
Returns
boolean
Whether all bits are set.
Remarks
This is stricter than is_any() and test(): every bit from mask must be present.
Implementation of
flags32.isis_any()
Call Signature
is_any(value: flags32, mask: number): boolean;Check whether any selected bit is set in a source mask.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | flags32 | Source mask. |
mask | number | Bits to test. |
Returns
boolean
Whether any bit is set.
Remarks
Use this for overlap checks. For an all-bits check, use is().
Implementation of
flags32.is_anyCall Signature
is_any(mask: number): boolean;Check whether any selected bit is set in this mask.
Parameters
| Parameter | Type | Description |
|---|---|---|
mask | number | Bits to test. |
Returns
boolean
Whether any bit is set.
Remarks
Use this for overlap checks. For an all-bits check, use is().
Implementation of
flags32.is_anyone()
one(): MockFlags32;Set all bits.
Returns
MockFlags32
This mask.
Remarks
Sets all 32 bits to 1.
Implementation of
flags32.oneor()
Call Signature
or(source: flags32, mask: number): MockFlags32;Replace this mask with source | mask.
Parameters
| Parameter | Type | Description |
|---|---|---|
source | flags32 | Source mask. |
mask | number | Bits to set. |
Returns
MockFlags32
This mask.
Implementation of
flags32.orCall Signature
or(mask: number): MockFlags32;Apply bitwise OR to this mask.
Parameters
| Parameter | Type | Description |
|---|---|---|
mask | number | Bits to set. |
Returns
MockFlags32
This mask.
Implementation of
flags32.orset()
set(mask: number, enabled: boolean): MockFlags32;Set or clear selected bits.
Parameters
| Parameter | Type | Description |
|---|---|---|
mask | number | Bits to update. |
enabled | boolean | Whether bits should be set. |
Returns
MockFlags32
This mask.
Implementation of
flags32.settest()
test(mask: number): boolean;Test whether any selected bit is set.
Parameters
| Parameter | Type | Description |
|---|---|---|
mask | number | Bits to test. |
Returns
boolean
Whether any selected bit is set.
Remarks
Equivalent to is_any(mask).
Implementation of
flags32.testzero()
zero(): MockFlags32;Clear all bits.
Returns
MockFlags32
This mask.
Implementation of
flags32.zerocreate()
static create(): MockFlags32;Returns
MockFlags32
mock()
static mock(): flags32;Returns
flags32