Search Results for

    Show / Hide Table of Contents

    Interface IObjectInfo

    Interface implemented by objects so that they can be selected and modified through the UI.

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

    Properties

    | Edit this page View Source

    Color

    The object's color.

    Declaration
    Color Color { get; set; }
    Property Value
    Type Description
    Color
    | Edit this page View Source

    Identifier

    The object's identifier. Does not have to be unique among all objects.

    Declaration
    int Identifier { get; set; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    Position

    Declaration
    Vector2Int Position { get; }
    Property Value
    Type Description
    Vector2Int
    | Edit this page View Source

    Size

    The number of nodes occupied by the object.

    Declaration
    int Size { get; }
    Property Value
    Type Description
    int

    Methods

    | Edit this page View Source

    AddPosition(Vector2Int)

    Adds the given global grid position to the object. Ideally, the position should be adjacent to the object. Disconnected objects will prevent the simulation from being started.

    Declaration
    void AddPosition(Vector2Int pos)
    Parameters
    Type Name Description
    Vector2Int pos

    The global grid position to be added.

    | Edit this page View Source

    IsAnchor()

    Checks whether this object is currently the anchor.

    Declaration
    bool IsAnchor()
    Returns
    Type Description
    bool

    true if and only if the object is the anchor.

    | Edit this page View Source

    IsConnected(Vector2Int)

    Checks whether the object occupies a connected set of grid nodes if the given node is removed.

    Declaration
    bool IsConnected(Vector2Int removePosition)
    Parameters
    Type Name Description
    Vector2Int removePosition

    The global grid position that should be removed from the object. This position is not considered as occupied in the connectivity check.

    Returns
    Type Description
    bool

    true if and only if the object is still a connected shape after removing the given position.

    | Edit this page View Source

    IsNeighborPosition(Vector2Int)

    Checks whether the given global grid position is adjacent to the object.

    Declaration
    bool IsNeighborPosition(Vector2Int pos)
    Parameters
    Type Name Description
    Vector2Int pos

    The global grid position to check.

    Returns
    Type Description
    bool

    true if and only if pos is adjacent to at least one position occupied by the object but is not occupied itself.

    | Edit this page View Source

    MakeAnchor()

    Turns this object into the anchor of the system.

    Declaration
    void MakeAnchor()
    | Edit this page View Source

    MoveToPosition(Vector2Int)

    Moves the object to the given global coordinates.

    Declaration
    bool MoveToPosition(Vector2Int newPos)
    Parameters
    Type Name Description
    Vector2Int newPos

    The global grid coordinates to which the object should be moved.

    Returns
    Type Description
    bool

    true if and only if the object was moved successfully.

    | Edit this page View Source

    OccupiedPositions()

    Computes the set of grid nodes occupied by the object.

    Declaration
    ICollection<Vector2Int> OccupiedPositions()
    Returns
    Type Description
    ICollection<Vector2Int>

    The global coordinates of all grid nodes occupied by the object.

    | Edit this page View Source

    RemoveFromSystem()

    Removes the object from the particle system and the render system.

    Declaration
    void RemoveFromSystem()
    | Edit this page View Source

    RemovePosition(Vector2Int)

    Removes the given global grid position from the object, if the object remains connected and non-empty.

    Note that the object's origin position will change if the node at the origin is removed.

    Declaration
    bool RemovePosition(Vector2Int pos)
    Parameters
    Type Name Description
    Vector2Int pos

    The global grid position to be removed.

    Returns
    Type Description
    bool

    true if and only if the given position was successfully removed from the object.

    • 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