math_bits is a point entity available with any version of Mapbase.

A math_counter variant that specializes in bitwise operations.



KeyValues

- Initial Value (startvalue) <integer>
The bits this entity should start with.

Inputs

- Add <integer>
Adds bit(s) to this entity's value and fires the OutValue output with the result.
- Subtract <integer>
Subtracts bit(s) to this entity's value and fires the OutValue output with the result.
- ShiftLeft <integer>
Shifts this entity's value to the left by the specified number and fires the OutValue output with the result.
- ShiftRight <integer>
Shifts this entity's value to the right by the specified number and fires the OutValue output with the result.
- SetValue <integer>
Changes this entity's value and fires the OutValue output with the result.
- SetValueNoFire <integer>
Changes this entity's value without firing any outputs.
- GetValue <void>
Causes this entity to fire its OnGetValue output with its current bits. Used for polling the current bits when you don't want constant updates from the OutValue output.
- ContainsBits <integer>
Tests whether this entity's current value contains at least one of the specified bit(s).
- ContainsAllBits <integer>
Tests whether this entity's current value contains all of the specified bit(s).

Outputs

- OutValue <integer>
Fired when the value changes.
- OnGetValue <integer>
Fired in response to the GetValue input. Used for polling the current bits when you don't want constant updates from the OutValue output.
- OnTrue <void>
Fired by ContainsBits when the current value contains the specified bit.
- OnFalse <void>
Fired by ContainsBits when the current value does not contain the specified bit.