sesaparcours
    Preparing search index...

    Fake class which should be extended to avoid inheriting static properties

    Hierarchy (View Summary)

    Index

    Constructors

    • Class for a variable map. This contains a dictionary data structure with variable types as keys and lists of variables as values. The list of variables are the type indicated by the key.

      Parameters

      Returns VariableMap__Class

    Properties

    workspace: Blockly.Workspace

    The workspace this map belongs to.

    Methods

    • Clear the variable map.

      Returns void

    • Create a variable with a given name, optional type, and optional ID.

      Parameters

      • name: string

        The name of the variable. This must be unique across variables and procedures.

      • Optionalopt_type: string

        The type of the variable like 'int' or 'string'. Does not need to be unique. Field_variable can filter variables based on their type. This will default to '' which is a specific type.

      • Optionalopt_id: string

        The unique ID of the variable. This will default to a UUID.

      Returns Blockly.VariableModel

      The newly created variable.

    • Delete a variable.

      Parameters

      Returns void

    • Delete a variables by the passed in ID and all of its uses from this workspace. May prompt the user for confirmation.

      Parameters

      • id: string

        ID of variable to delete.

      Returns void

    • Deletes a variable and all of its uses from this workspace without asking the user for confirmation.

      Parameters

      Returns void

    • Returns all of the variable names of all types.

      Returns string[]

      All of the variable names of all types.

    • Return all variables of all types.

      Returns Blockly.VariableModel[]

      List of variable models.

    • Find the variable by the given name and type and return it. Return null if it is not found.

      Parameters

      • name: string

        The name to check for.

      • Optionalopt_type: string

        The type of the variable. If not provided it defaults to the empty string, which is a specific type.

      Returns Blockly.VariableModel

      The variable with the given name, or null if it was not found.

    • Find the variable by the given ID and return it. Return null if not found.

      Parameters

      • id: string

        The ID to check for.

      Returns Blockly.VariableModel

      The variable with the given ID.

    • Get a list containing all of the variables of a specified type. If type is null, return list of variables with empty string type.

      Parameters

      • type: string

        Type of the variables to find.

      Returns Blockly.VariableModel[]

      The sought after variables of the passed in type. An empty array if none are found.

    • Return all variable and potential variable types. This list always contains the empty string.

      Parameters

      • ws: Blockly.Workspace

        The workspace used to look for potential variables. This can be different than the workspace stored on this object if the passed in ws is a flyout workspace.

      Returns string[]

      List of variable types.

    • Find all the uses of a named variable.

      Parameters

      • id: string

        ID of the variable to find.

      Returns Blockly.Block[]

      Array of block usages.

    • Rename the given variable by updating its name in the variable map.

      Parameters

      Returns void

    • Rename a variable by updating its name in the variable map. Identify the variable to rename with the given ID.

      Parameters

      • id: string

        ID of the variable to rename.

      • newName: string

        New variable name.

      Returns void