Socket

class in Doozy.Engine.Nody.Models

Description

The Socket is an integral part of a Node that manages a list Connections and connection points
See Also: Node, Connection

Properties

  • public bool AcceptsMultipleConnections – Returns TRUE if this socket can establish multiple connections

  • public bool CanBeDeleted – [Editor Only] Returns TRUE if this socket can be removed. This is used to make sure important sockets cannot be deleted by the developer and break the node settings / graph functionality / user experience

  • public bool CanBeReordered – [Editor Only] Returns TRUE if this socket can be reordered. This is used to prevent special sockets from being reordered in the node

  • public List<Vector2> ConnectionPoints – [Editor Only] Keeps track of all the Connection Points this socket has

  • public List<Connection> Connections – Keeps track of all the Connections this socket has

  • public float CurveModifier – [Editor Only] Returns the curve modifier for this socket. Editor option to adjust the connections curve strength

  • public Connection FirstConnection – Returns the first Connection this socket has. Returns null if no connection exists

  • public Rect HoverRect – [Editor Only] Overlay image Rect that is drawn on mouse hover. Also used to calculate if to show the socket context menu

  • public string Id – Returns this socket’s id

  • public bool IsConnected – Returns TRUE if this socket has at least one connection (it checks the Connections count)

  • public bool IsInput – Returns TRUE if this is an Input socket

  • public bool IsOutput – Returns TRUE if this is an Output socket

  • public bool OverrideConnection – Returns TRUE if this socket can establish only ONE connection

  • public string NodeId – Returns this socket’s parent node id

  • public string SocketName – Returns this socket’s name

  • public string Value – Returns the socket’s value as a string

  • public System.Type ValueType – Returns the value type this socket has and automatically updates the m_valueType if needed

  • private string ValueTypeQualifiedName – Returns the Connection TypeQualifiedName and automatically updates the m_valueType if needed

Constructors

Public Methods

  • public bool CanConnect(Socket other, bool ignoreValueType = false) – Returns TRUE if this socket can connect to another socket

  • public bool ContainsConnection(string connectionId) – Returns TRUE if this socket contains a Connection with the given connection id

  • public bool ContainsConnection(Connection connection) – Returns TRUE if this socket contains the given Connection

  • public void Disconnect() – Removes ALL the Connections this socket has, by clearing the Connections list

  • public void DisconnectFromNode(string nodeId) – Disconnect this socket from the given node id

  • public Vector2 GetClosestConnectionPointToPosition(Vector2 position) – [Editor Only] Returns the closest own connection point to position

  • public Vector2 GetClosestConnectionPointToSocket(Socket other) – [Editor Only] Returns the closest own connection point to the closest connection point on the other socket

  • public List<string> GetConnectedNodesIds() – Returns a list of all the node ids that are connected to this socket. If not connected to any other node, it will return an empty list

  • public List<string> GetConnectedSocketIds() – Returns a list of all the socket ids that are connected with this socket. If not connected to any other socket, it will return an empty list

  • public Connection GetConnection(string connectionId) – Returns the Connection with the given id. If not found it will return null

  • public List<string> GetConnectionIds() – Returns a list of all the connections ids of this socket

  • public ConnectionMode GetConnectionMode() – Returns the connection mode this socket has (Multiple/Override)

  • public SocketDirection GetDirection() – Returns the direction this socket has (Input/Output)

  • public string GenerateNewId() – Generates a new unique socket id for this socket and returns the newly generated id value

  • public float GetHeight() – [Editor Only] Returns the height of this socket

  • public Vector2 GetPosition() – [Editor Only] Returns the position of this socket

  • public Rect GetRect() – [Editor Only] Returns the Rect of this socket

  • public Vector2 GetSize() – [Editor Only] Returns the size of this socket (x is width, y is height)

  • public float GetWidth() – [Editor Only] Returns the width of this socket

  • public float GetX() – [Editor Only] Returns the x coordinate of this socket

  • public float GetY() – [Editor Only] Returns the y coordinate of this socket

  • public bool IsConnectedToNode(string nodeId) – Returns TRUE if this socket is connected to the given node id

  • public bool IsConnectedToSocket(string socketId) – Returns TRUE if this socket is connected to the given socket id

  • public void RemoveConnection(string connectionId) – Removes a connection with the given connection id from this socket

  • public void SetHeight(float value) – [Editor Only] Sets the height of this socket’s Rect

  • public void SetName(string value) – Set the name for this socket

  • public void SetPosition(Vector2 position) – [Editor Only] Sets the position of this socket’s Rect

  • public void SetPosition(float x, float y) – [Editor Only] Sets the position of this socket’s Rect

  • public void SetRect(Rect rect) – [Editor Only] Sets the Rect value for this socket

  • public void SetRect(Vector2 position, Vector2 size) – [Editor Only] Sets the Rect values for this socket

  • public void SetRect(float x, float y, float width, float height) – [Editor Only] Sets the Rect values for this socket

  • public void SetSize(Vector2 size) – [Editor Only] Sets the size of this socket’s Rect

  • public void SetSize(float width, float height) – [Editor Only] Sets the size of this socket’s Rect

  • public void SetWidth(float value) – [Editor Only] Sets the width of this socket’s Rect

  • public void SetX(float value) – [Editor Only] Sets the x coordinate of this socket’s Rect

  • public void SetY(float value) – [Editor Only] Sets the y coordinate of this socket’s Rect

  • public void UpdateHoverRect() – [Editor Only] Updates the socket hover Rect. This is the ‘selection’ box that appears when the mouse is over the socket