sesaparcours
    Preparing search index...

    Fake class which should be extended to avoid inheriting static properties

    Hierarchy (View Summary)

    Index

    Constructors

    • Database of connections. Connections are stored in order of their vertical component. This way connections in an area may be looked up quickly using a binary search.

      Parameters

      • checker: IConnectionChecker

        The workspace's connection type checker, used to decide if connections are valid during a drag.

      Returns ConnectionDB__Class

    Methods

    • Add a connection to the database. Should not already exist in the database.

      Parameters

      • connection: Blockly.RenderedConnection

        The connection to be added.

      • yPos: number

        The y position used to decide where to insert the connection.

      Returns void

    • Find all nearby connections to the given connection. Type checking does not apply, since this function is used for bumping.

      Parameters

      • connection: Blockly.RenderedConnection

        The connection whose neighbours should be returned.

      • maxRadius: number

        The maximum radius to another connection.

      Returns Blockly.RenderedConnection[]

      List of connections.

    • Remove a connection from the database. Must already exist in DB.

      Parameters

      • connection: Blockly.RenderedConnection

        The connection to be removed.

      • yPos: number

        The y position used to find the index of the connection.

      Returns void

      If the connection cannot be found in the database.

    • Find the closest compatible connection to this connection.

      Parameters

      • conn: Blockly.RenderedConnection

        The connection searching for a compatible mate.

      • maxRadius: number

        The maximum radius to another connection.

      • dxy: Blockly.utils.Coordinate

        Offset between this connection's location in the database and the current location (as a result of dragging).

      Returns { connection: Blockly.RenderedConnection; radius: number }

      Contains two properties: 'connection' which is either another connection or null, and 'radius' which is the distance.