Search Results for

    Show / Hide Table of Contents

    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

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

    Constructors

    | Edit this page View Source

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

    bit_mask

    Declaration
    protected int bit_mask
    Field Value
    Type Description
    int
    | Edit this page View Source

    length

    Declaration
    public readonly int length
    Field Value
    Type Description
    int

    Methods

    | Edit this page View Source

    GetCurrentOr()

    Returns the logical OR of all latest stored bits.

    Declaration
    public bool GetCurrentOr()
    Returns
    Type Description
    bool

    true if and only if any of the latest stored bits are true.

    | Edit this page View Source

    GetCurrentValue()

    Returns the latest value.

    Uses the default index 0.

    Declaration
    public override bool GetCurrentValue()
    Returns
    Type Description
    bool
    Overrides
    BinAttribute<bool>.GetCurrentValue()
    | Edit this page View Source

    GetCurrentValue(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 index decoded from the int's latest value.

    | Edit this page View Source

    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

    true if and only if any of the stored bits are true at the beginning of the round.

    | Edit this page View Source

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

    GetValue(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 index decoded from the int's snapshot value.

    | Edit this page View Source

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

    SetValue(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.

    • 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