Class BinAttributeInt
A binary encoded attribute for integers using less space than a full int.
Namespace: AS2.Subroutines.BinStateHelpers
Assembly: .dll
Syntax
public class BinAttributeInt : BinAttribute<int>
Constructors
| Edit this page View SourceBinAttributeInt(ParticleAttribute<int>, int, int)
Creates a new attribute wrapper referencing the given state attribute int.
Declaration
public BinAttributeInt(ParticleAttribute<int> attr, int idx, int width)
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 | width | The number of bits occupied by the integer. |
Fields
| Edit this page View Sourcebit_mask
Declaration
protected int bit_mask
Field Value
| Type | Description |
|---|---|
| int |
Methods
| Edit this page View SourceGetCurrentValue()
Returns the latest value.
Declaration
public override int GetCurrentValue()
Returns
| Type | Description |
|---|---|
| int | The value decoded from the int's latest value. |
Overrides
| Edit this page View SourceGetValue()
Returns the value from the beginning of the current round.
Declaration
public override int GetValue()
Returns
| Type | Description |
|---|---|
| int | The value decoded from the int's snapshot value. |
Overrides
| Edit this page View SourceSetValue(int)
Writes a new value to the state integer.
Declaration
public override void SetValue(int value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | value | The new value to be written. |