Class BinAttributeDirection
Binary encoded attribute for Direction values.
A direction is encoded in 3 bits and the bits 000
represent
NONE. Only cardinal directions are encoded.
Namespace: AS2.Subroutines.BinStateHelpers
Assembly: .dll
Syntax
public class BinAttributeDirection : BinAttribute<Direction>
Constructors
| Edit this page View SourceBinAttributeDirection(ParticleAttribute<int>, int)
Creates a new attribute wrapper referencing the given state attribute int.
Declaration
public BinAttributeDirection(ParticleAttribute<int> attr, int idx)
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. |
Fields
| Edit this page View Sourcebit_mask
Declaration
protected const int bit_mask = 7
Field Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceGetCurrentValue()
Returns the latest value.
Declaration
public override Direction GetCurrentValue()
Returns
Type | Description |
---|---|
Direction | 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 Direction GetValue()
Returns
Type | Description |
---|---|
Direction | The value decoded from the int's snapshot value. |
Overrides
| Edit this page View SourceSetValue(Direction)
Writes a new value to the state integer.
Declaration
public override void SetValue(Direction dir)
Parameters
Type | Name | Description |
---|---|---|
Direction | dir |