Options
All
• Public
• Public/Protected
• All

## Constructors

### constructor

#### Parameters

• ##### value: number = 0

The current value of the bit mask, defaults to `0`

• ##### bits: T[] = []

The array of names to use e.g. `['canOpen', 'canClose']`

## Properties

bits: T[]

### value

value: number

The current value of the mask

## Methods

### _get

• _get(bit: number): boolean

### _set

• _set(bit: number, value: boolean): void

### asArray

• asArray(): T[]

### asIndexArray

• asIndexArray(): number[]
• Returns an array of indexes in the bits array that are currently true.

### fromIndexArray

• fromIndexArray(indexs: number[]): void
• Sets all values in the mask to true if they are in the array and false if they are not.

#### Parameters

• ##### indexs: number[]

An array of indexes in the bits array that need to be true.1

### get

• get(name: T): boolean
• Checks the given bit name for its boolean value.

#### Parameters

• ##### name: T

The name of the bit to check. e.g. `canOpen`

### set

• set(name: T, value: boolean): void
• Sets the given bit to the supplied value.

#### Parameters

• ##### name: T

The name of the bit to set e.g. `canClose`

• ##### value: boolean

The boolean value to set it to.

#### Returns void

Generated using TypeDoc
{"ft_lang_label":"__label__en","ft_lang_prob":0.7359658,"math_prob":0.53667283,"size":610,"snap":"2021-31-2021-39","text_gpt3_token_len":153,"char_repetition_ratio":0.1650165,"word_repetition_ratio":0.13793103,"special_character_ratio":0.23442623,"punctuation_ratio":0.114285715,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9532774,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-07-26T04:05:24Z\",\"WARC-Record-ID\":\"<urn:uuid:3de7c028-f40d-44d0-bb2a-bafdf07fbcf0>\",\"Content-Length\":\"22361\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:1ff31b44-f8d7-4a26-a06a-2427a571fd19>\",\"WARC-Concurrent-To\":\"<urn:uuid:04bd9813-d221-4ccc-9d85-b9bb3f201045>\",\"WARC-IP-Address\":\"185.199.111.153\",\"WARC-Target-URI\":\"https://utils.arcath.net/classes/bitmask.html\",\"WARC-Payload-Digest\":\"sha1:JLE5OR6PWE54P2TTXIUBPG2MDQ2QVRRY\",\"WARC-Block-Digest\":\"sha1:OVSGO3R2L2CI53HIS77QZ4H3N2PK3NMP\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-31/CC-MAIN-2021-31_segments_1627046152000.25_warc_CC-MAIN-20210726031942-20210726061942-00457.warc.gz\"}"}