Search Results for

    Show / Hide Table of Contents

    Interface IParticleState

    Implemented by the particles. Contains helpful methods for the view to access standardized data from particles.

    Namespace: AS2.Visuals
    Assembly: .dll
    Syntax
    public interface IParticleState

    Methods

    | Edit this page View Source

    AlgorithmName()

    Gets the name of the algorithm running this particle's behavior.

    Declaration
    string AlgorithmName()
    Returns
    Type Description
    string

    The unique display name of the algorithm running this particle.

    | Edit this page View Source

    Chirality()

    Returns the chirality of the particle. true means counter-clockwise and false means clockwise.

    Declaration
    bool Chirality()
    Returns
    Type Description
    bool

    The chirality of the particle.

    | Edit this page View Source

    CompassDir()

    Returns the global compass orientation of the particle. This is the global direction that the particle identifies as E in its local view.

    Declaration
    Direction CompassDir()
    Returns
    Type Description
    Direction

    The global compass orientation of the particle.

    | Edit this page View Source

    GetAttributes()

    Returns a list of all ParticleAttribute<T>s of the particle.

    Declaration
    List<IParticleAttribute> GetAttributes()
    Returns
    Type Description
    List<IParticleAttribute>

    A list containing all attributes of the particle.

    | Edit this page View Source

    GetCircuitPinsPerSide()

    Returns the number of pins per side at the particle.

    Declaration
    int GetCircuitPinsPerSide()
    Returns
    Type Description
    int
    | Edit this page View Source

    GetGraphicsAdapter()

    Returns the graphics adapter for the particle.

    Declaration
    IParticleGraphicsAdapter GetGraphicsAdapter()
    Returns
    Type Description
    IParticleGraphicsAdapter
    | Edit this page View Source

    GetParticleColor()

    Method to get the particle color for the visualization.

    Declaration
    Color GetParticleColor()
    Returns
    Type Description
    Color
    | Edit this page View Source

    GlobalHeadDirectionInt()

    The global direction of an expansion. Returns -1 if there is no expansion.

    Declaration
    int GlobalHeadDirectionInt()
    Returns
    Type Description
    int
    | Edit this page View Source

    Head()

    Head position of the particle.

    Declaration
    Vector2Int Head()
    Returns
    Type Description
    Vector2Int
    | Edit this page View Source

    IsAnchor()

    Checks if the particle is currently the anchor of the system. The anchor particle defines how the system moves during a joint movement by keeping its global position.

    Declaration
    bool IsAnchor()
    Returns
    Type Description
    bool

    true if and only if this particle is the anchor.

    | Edit this page View Source

    IsExpanded()

    True if the particle is expanded, false if not.

    Declaration
    bool IsExpanded()
    Returns
    Type Description
    bool
    | Edit this page View Source

    IsParticleColorSet()

    Checks if the particle color has been overwritten.

    Declaration
    bool IsParticleColorSet()
    Returns
    Type Description
    bool

    true if and only if the particle color was overwritten by the particle algorithm.

    | Edit this page View Source

    MakeAnchor()

    Turns this particle into the anchor of the system. The anchor particle defines how the system moves during a joint movement by keeping its global position.

    Declaration
    bool MakeAnchor()
    Returns
    Type Description
    bool

    true if and only if the particle was successfully turned into the anchor.

    | Edit this page View Source

    SetChirality(bool)

    Sets the particle's chirality to the given value. Only works if the particle is in a state that allows the chirality to be set.

    Declaration
    void SetChirality(bool chirality)
    Parameters
    Type Name Description
    bool chirality

    The new chirality. true means counter-clockwise, false means clockwise.

    | Edit this page View Source

    SetChiralityRandom()

    Sets the particle's chirality to a random value. Only works if the particle is in a state that allows the chirality to be set.

    Declaration
    void SetChiralityRandom()
    | Edit this page View Source

    SetCompassDir(Direction)

    Sets the particle's compass direction to the given value. Only works if the particle is in a state that allows the compass to be set.

    Declaration
    void SetCompassDir(Direction compassDir)
    Parameters
    Type Name Description
    Direction compassDir

    The new compass direction, given as a global cardinal direction.

    | Edit this page View Source

    SetCompassDirRandom()

    Sets the particle's compass direction to a random value. Only works if the particle is in a state that allows the compass to be set.

    Declaration
    void SetCompassDirRandom()
    | Edit this page View Source

    Tail()

    Tail position of the particle. Same as Head() if the particle is not expanded.

    Declaration
    Vector2Int Tail()
    Returns
    Type Description
    Vector2Int
    | Edit this page View Source

    TryGetAttributeByName(string)

    Provides access to ParticleAttribute<T>s by their display names.

    Declaration
    IParticleAttribute TryGetAttributeByName(string attrName)
    Parameters
    Type Name Description
    string attrName

    The display of the attribute to return.

    Returns
    Type Description
    IParticleAttribute

    The particle's attribute with the given name attrName if it exists, otherwise null.

    • 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