Search Results for

    Show / Hide Table of Contents

    Class EdgeMovement

    Represents the movement of a length 1 edge during one round for the collision check.

    If the edge belongs to an expanding or contracting particle, its start and end points will coincide either before or after the movement.

    Use the pooling methods Create(Vector2Int, Vector2Int, Vector2Int, Vector2Int) and Release(EdgeMovement) to avoid allocating new memory for every new edge.

    Inheritance
    object
    EdgeMovement
    Namespace: AS2.Sim
    Assembly: .dll
    Syntax
    public class EdgeMovement

    Constructors

    | Edit this page View Source

    EdgeMovement(Vector2Int, Vector2Int, Vector2Int, Vector2Int)

    Declaration
    private EdgeMovement(Vector2Int s1, Vector2Int e1, Vector2Int s2, Vector2Int e2)
    Parameters
    Type Name Description
    Vector2Int s1
    Vector2Int e1
    Vector2Int s2
    Vector2Int e2

    Fields

    | Edit this page View Source

    end1

    The end position before the movement.

    Declaration
    public Vector2Int end1
    Field Value
    Type Description
    Vector2Int
    | Edit this page View Source

    end2

    The end position after the movement.

    Declaration
    public Vector2Int end2
    Field Value
    Type Description
    Vector2Int
    | Edit this page View Source

    pool

    Declaration
    private static Stack<EdgeMovement> pool
    Field Value
    Type Description
    Stack<EdgeMovement>
    | Edit this page View Source

    start1

    The start position before the movement.

    Declaration
    public Vector2Int start1
    Field Value
    Type Description
    Vector2Int
    | Edit this page View Source

    start2

    The start position after the movement.

    Declaration
    public Vector2Int start2
    Field Value
    Type Description
    Vector2Int

    Methods

    | Edit this page View Source

    Create(Vector2Int, Vector2Int, Vector2Int, Vector2Int)

    Creates an instance with the given points using pooling.

    Declaration
    public static EdgeMovement Create(Vector2Int s1, Vector2Int e1, Vector2Int s2, Vector2Int e2)
    Parameters
    Type Name Description
    Vector2Int s1

    The start location before the movement.

    Vector2Int e1

    The end location before the movement.

    Vector2Int s2

    The start location after the movement.

    Vector2Int e2

    The end location after the movement.

    Returns
    Type Description
    EdgeMovement

    A newly initialized instance.

    | Edit this page View Source

    EndTranslation()

    Calculates the movement of the edge's end position.

    Declaration
    public Vector2Int EndTranslation()
    Returns
    Type Description
    Vector2Int

    The vector pointing from the edge's end position before the movement to its position after the movement.

    | Edit this page View Source

    Release(EdgeMovement)

    Releases the given instance into the pool. Use this when the instance is not used any more to recycle the allocated memory.

    Declaration
    public static void Release(EdgeMovement em)
    Parameters
    Type Name Description
    EdgeMovement em

    The instance to be reinserted into the pool.

    | Edit this page View Source

    Reset()

    Declaration
    public void Reset()
    | Edit this page View Source

    Reset(Vector2Int, Vector2Int, Vector2Int, Vector2Int)

    Declaration
    public void Reset(Vector2Int s1, Vector2Int e1, Vector2Int s2, Vector2Int e2)
    Parameters
    Type Name Description
    Vector2Int s1
    Vector2Int e1
    Vector2Int s2
    Vector2Int e2
    | Edit this page View Source

    StartTranslation()

    Calculates the movement of the edge's start position.

    Declaration
    public Vector2Int StartTranslation()
    Returns
    Type Description
    Vector2Int

    The vector pointing from the edge's start position before the movement to its position after the movement.

    | Edit this page View Source

    ToString()

    Returns a string that represents the current object.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string that represents the current object.

    Overrides
    object.ToString()
    • 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