Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    BinAttribute<Direction>
    BinAttributeDirection
    Namespace: AS2.Subroutines.BinStateHelpers
    Assembly: .dll
    Syntax
    public class BinAttributeDirection : BinAttribute<Direction>

    Constructors

    | Edit this page View Source

    BinAttributeDirection(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 Source

    bit_mask

    Declaration
    protected const int bit_mask = 7
    Field Value
    Type Description
    int

    Methods

    | Edit this page View Source

    GetCurrentValue()

    Returns the latest value.

    Declaration
    public override Direction GetCurrentValue()
    Returns
    Type Description
    Direction

    The value decoded from the int's latest value.

    Overrides
    BinAttribute<Direction>.GetCurrentValue()
    | Edit this page View Source

    GetValue()

    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
    BinAttribute<Direction>.GetValue()
    | Edit this page View Source

    SetValue(Direction)

    Writes a new value to the state integer.

    Declaration
    public override void SetValue(Direction dir)
    Parameters
    Type Name Description
    Direction dir
    Overrides
    BinAttribute<Direction>.SetValue(Direction)
    • Edit this page
    • View Source
    In this article
    Back to top AmoebotSim 2.0 Documentation v1.11
    Copyright © 2025 AmoebotSim 2.0 Authors
    Generated by DocFX