Search Results for

    Show / Hide Table of Contents

    Interface IParticleAttribute

    Interface defining how particle attributes can be used by the System and the UI.

    Namespace: AS2.Sim
    Assembly: .dll
    Syntax
    public interface IParticleAttribute : IReplayHistory

    Methods

    | Edit this page View Source

    GenerateSaveData()

    Returns a serializable object representing the attribute's data.

    Declaration
    ParticleAttributeSaveDataBase GenerateSaveData()
    Returns
    Type Description
    ParticleAttributeSaveDataBase

    An instance of a subclass of ParticleAttributeSaveDataBase matching the attribute's type.

    | Edit this page View Source

    GetAttributeType()

    Returns the type of the attribute's value.

    Declaration
    Type GetAttributeType()
    Returns
    Type Description
    Type

    The type of value stored in the attribute.

    | Edit this page View Source

    GetObjectValue()

    Returns the attribute's current value as an object.

    Declaration
    object GetObjectValue()
    Returns
    Type Description
    object

    The attribute's current value.

    | Edit this page View Source

    ResetIntermediateValue()

    Resets the attribute's intermediate value state. Must be called after each simulated round.

    Intermediate values are used to keep a value written during the movement phase available in the beep phase. This is necessary because a simulation round contains two activations and an attribute value can change in each of the phases.

    Declaration
    void ResetIntermediateValue()
    | Edit this page View Source

    RestoreFromSaveData(ParticleAttributeSaveDataBase)

    Loads the attribute data from the given serializable object and resets this attribute to the state encoded in that data.

    Declaration
    bool RestoreFromSaveData(ParticleAttributeSaveDataBase data)
    Parameters
    Type Name Description
    ParticleAttributeSaveDataBase data

    A serializable representation of a particle attribute state.

    Returns
    Type Description
    bool

    true if and only if the state update was successful.

    | Edit this page View Source

    SetRandomValue()

    Sets the attribute's value to a random value if the attribute type allows this.

    Declaration
    bool SetRandomValue()
    Returns
    Type Description
    bool

    true if and only if the value was updated successfully.

    | Edit this page View Source

    ToString()

    String representation of the attribute and its current state.

    Declaration
    string ToString()
    Returns
    Type Description
    string

    A string containing the attribute's type, its display name, and its current value.

    | Edit this page View Source

    ToString_AttributeName()

    The attribute's name to be displayed in the UI.

    Declaration
    string ToString_AttributeName()
    Returns
    Type Description
    string

    The attribute's display name.

    | Edit this page View Source

    ToString_AttributeValue()

    String representation of the attribute's current value.

    Declaration
    string ToString_AttributeValue()
    Returns
    Type Description
    string

    A string containing the attribute's current value.

    | Edit this page View Source

    UpdateAttributeValue(string)

    Updates the attribute's value to the one represented by the given string.

    Declaration
    bool UpdateAttributeValue(string value)
    Parameters
    Type Name Description
    string value

    String representation of the new value.

    Returns
    Type Description
    bool

    true if and only if the given string was parsed successfully.

    • 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