Class BinAttributeBitField
Binary encoded attribute for arrays of up to 32 bool values. Each bool is represented by a single bit. If the given start index is greater than 0, the maximum number of bits is reduced
Namespace: AS2.Subroutines.BinStateHelpers
Assembly: .dll
Syntax
public class BinAttributeBitField : BinAttribute<bool>
Constructors
| Edit this page View SourceBinAttributeBitField(ParticleAttribute<int>, int, int)
Creates a new attribute wrapper referencing the given state attribute int.
Declaration
public BinAttributeBitField(ParticleAttribute<int> attr, int idx, int length)
Parameters
Type | Name | Description |
---|---|---|
ParticleAttribute<int> | attr | The attribute storing the integer that contains this value as a subset of bits. |
int | idx | The bit index at which the encoding of this value starts. |
int | length | The number of bits in the array. |
Fields
| Edit this page View Sourcebit_mask
Declaration
protected int bit_mask
Field Value
Type | Description |
---|---|
int |
length
Declaration
public readonly int length
Field Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceGetCurrentOr()
Returns the logical OR of all latest stored bits.
Declaration
public bool GetCurrentOr()
Returns
Type | Description |
---|---|
bool |
|
GetCurrentValue()
Returns the latest value.
Uses the default index 0.
Declaration
public override bool GetCurrentValue()
Returns
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceGetCurrentValue(int)
Returns the latest value.
Declaration
public bool GetCurrentValue(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the bit to return. |
Returns
Type | Description |
---|---|
bool | The value at index |
GetOr()
Returns the logical OR of all stored bits for the value at the beginning of the round.
Declaration
public bool GetOr()
Returns
Type | Description |
---|---|
bool |
|
GetValue()
Returns the value from the beginning of the current round.
Uses the default index 0.
Declaration
public override bool GetValue()
Returns
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceGetValue(int)
Returns the value from the beginning of the current round.
Declaration
public bool GetValue(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the bit to return. |
Returns
Type | Description |
---|---|
bool | The bit value at index |
SetValue(bool)
Writes a new value to the state integer.
Uses the default index 0.
Declaration
public override void SetValue(bool value)
Parameters
Type | Name | Description |
---|---|---|
bool | value | The new value to be written. |
Overrides
| Edit this page View SourceSetValue(int, bool)
Writes a new value to the state integer.
Declaration
public void SetValue(int index, bool value)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the bit to be written. |
bool | value | The new value to be written. |