Class ControlFlowNodeBase

The ControlFlowNodeBase extends the GraphNode class with basic infrastructure for control flow execution.

Hierarchy (view full)

Constructors

Accessors

  • get customName(): string
  • The custom name for the node.

    Returns string

    By default, names should be inferred from the GraphNodeReflection data. Only set this field if the name cannot or should not be inferred from reflection data.

  • set customName(value): void
  • Parameters

    • value: string

    Returns void

  • get id(): UUID
  • The ID.

    Returns UUID

  • get inputPins(): GraphPin[]
  • The input pins.

    Returns GraphPin[]

  • get outputPins(): GraphPin[]
  • The output pins.

    Returns GraphPin[]

  • get userData(): Map<string, any>
  • A map suitable for storing custom user-defined data.

    Returns Map<string, any>

Methods

  • Removes all connections to this node.

    Returns void

  • Enables the node and its pins in the specified graph.

    Parameters

    Returns void

  • Gets a pin that supports a connection to (or from) the otherPin.

    Parameters

    • otherPin: GraphPin

      The pin to find a compatible pin for.

    Returns GraphPin

    The first pin that matches the connection criteria.

    The orientation of the test depends on the type of the otherPin. The input pin denotes the type that must be supported by the output pin in the form

    	`outputPin isSubclassOf inputPin`
    
  • Gets the connection for the next node that should be executed.

    Parameters

    • OptionalpinOrName: string | GraphPin

      The pin name or reference that the execution will proceed from.

    Returns GraphConnection

  • Gets the value for the specified user data key. If the key does not exist the defaultValue will be returned instead. If no defaultValue is specified, undefined is returned.

    Type Parameters

    • T

    Parameters

    • node: GraphNode
    • key: string

      A key that uniquely identifies the property to be fetched.

    • OptionaldefaultValue: T

      The default value, to be returned in case the property is not defined.

    Returns T

    The user defined property or defaultValue if not defined.

  • Iterates all connections to pins of this node. First input pins are iterated over, then output pins.

    Returns Generator<GraphPin, any, any>

  • Called when the node has been instanced and is about to be added to a graph. This is a good place to initialize the default values for the node pins as it will then not be done during deserialization, which might otherwise discard newly instances values immediately.

    Returns void

  • Virtual

    Invoked when the node is being executed to perform it's logica and return the next node to be executed in the control flow graph.

    Parameters

    Returns GraphConnection

    Override this method with your node's control-flow execution logic. Implementing classes must call super. Data that is calculated as part of the execution must be stored in the GraphExecutionState that is available through the ControlFlowData. Stored data must be returned for the corresponding input pin in onRequestValue.

  • Called before the node is removed from a graph.

    Returns void

  • Removes the user data key.

    Parameters

    • key: string

    Returns void

  • Sets the user data key to the specified value.

    Type Parameters

    • T

    Parameters

    • key: string

      A key that uniquely identifies the property to be defined.

    • value: T

      The value to set the property to. The value type must support serialization.

    Returns void

  • Synchronizes the node pins with the reflection data by adding missing pins and removing superfluous pins on the node.

    Returns void

  • Returns a string representation of an object.

    Returns string

  • Virtual

    Ensures that the state of the node is valid.

    Parameters

    Returns GraphValidationStatus

    Implementing classes must call super. The method is typically called after deserialization or major edits to the graph. If validation fails, error information must be added to the validationStatus map.

  • Invokes the callback while prevent events to be dispatched.

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

Events

onDirty: Event<[EnumValueTyped<GraphNodeDirtyFlags, number>], void>

An event when the node is dirtied.