DynamicBitset
A set of bits that can be dynamically resized.
| Type | Name | Interface Description |
|---|---|---|
| Functions | constructor() | • Function: Constructs a new instance of the DynamicBitset class. |
| Functions | constructor(num_bits: number, value: number) | • Function: Constructs a new DynamicBitset with a specified number of bits. Parameters • • |
| Functions | any(): boolean | • Function: Checks if any bit is set to 1. Returns |
| Functions | equals(v: DynamicBitset): boolean | • Function: Compares this DynamicBitset with another for equality. Parameters • Returns |
| Functions | none(): boolean | • Function: Checks if no bits are set to 1. Returns |
| Functions | reset(v: number): DynamicBitset | • Function: Resets the bitset to a specified value. Parameters • Returns The modified DynamicBitset instance. |
| Functions | set(v?: number, v1?: number): void | • Function: Set the value in the dynamic bitset. If no arguments are provided, sets the default value. If one argument is provided, sets the value at the specified index. If two arguments are provided, sets the range of values from the start index to the end index. Parameters • • |
| Functions | test(v: number): boolean | • Function: Tests if a bit is set. Parameters • Returns |
| Functions | toString(): string | • Function: Returns a string representation of the DynamicBitset. Returns A string representing the current state of the DynamicBitset. |
| Static Functions | equals(v0: DynamicBitset, v1: DynamicBitset): boolean | • Function: Compares two DynamicBitset instances for equality. Parameters • • Returns |
Examples
constructor()
let obj = new APJS.DynamicBitset();
constructor(num_bits: number, value: number)
let obj = new APJS.DynamicBitset();
Use Case
@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
onStart() {
// TODO: instantiate / use DynamicBitset here
}
onUpdate(deltaTime: number) {
}
}