Table of Contents

Class Pin

Namespace
Artemis.Core
Assembly
Artemis.Core.dll

Represents a pin containing a value on a INode

public abstract class Pin : CorePropertyChanged, IPin
Inheritance
object
CorePropertyChanged
Pin
Implements
Derived

Constructors

Pin(INode, string)

Creates a new instance of the Pin class on the provided node with the provided name

protected Pin(INode node, string name = "")

Parameters

node INode

The node the pin belongs to

name string

The name of the pin

Properties

ConnectedTo

Gets a read only list of pins this pin is connected to

public IReadOnlyList<IPin> ConnectedTo { get; }

Property Value

IReadOnlyList<IPin>

Direction

Gets the direction of the pin

public abstract PinDirection Direction { get; }

Property Value

PinDirection

IsEvaluated

Gets or sets a boolean indicating whether this pin is evaluated or not

public bool IsEvaluated { get; set; }

Property Value

bool

IsNumeric

Gets a boolean indicating whether the type of this pin is numeric.

public bool IsNumeric { get; protected set; }

Property Value

bool

Name

Gets or sets the name of the pin

public string Name { get; set; }

Property Value

string

Node

Gets the node the pin belongs to

public INode Node { get; }

Property Value

INode

PinValue

Gets the value the pin holds

public abstract object? PinValue { get; }

Property Value

object

Type

Gets the type of value the pin holds

public abstract Type Type { get; }

Property Value

Type

Methods

ChangeType(Type, ref Type)

Changes the type of this pin, disconnecting any pins that are incompatible with the new type.

protected void ChangeType(Type type, ref Type currentType)

Parameters

type Type

The new type of the pin.

currentType Type

The backing field of the current type of the pin.

ConnectTo(IPin)

Connects the pin to the provided pin

public void ConnectTo(IPin pin)

Parameters

pin IPin

The pin to connect this pin to

DisconnectAll()

Disconnects all pins this pin is connected to

public void DisconnectAll()

DisconnectFrom(IPin)

Disconnects the pin to the provided pin

public void DisconnectFrom(IPin pin)

Parameters

pin IPin

The pin to disconnect this pin to

IsTypeCompatible(Type, bool)

Determines whether this pin is compatible with the given type

public bool IsTypeCompatible(Type type, bool forgivingEnumMatching = true)

Parameters

type Type

The type to check for compatibility

forgivingEnumMatching bool

A boolean indicating whether or not enums should be exactly equal or just both be enums

Returns

bool

true if the type is compatible, otherwise false.

Reset()

Resets the pin, causing it to re-evaluate the next time its value is requested

public void Reset()

Events

PinConnected

Occurs when the pin connects to another pin

public event EventHandler<SingleValueEventArgs<IPin>>? PinConnected

Event Type

EventHandler<SingleValueEventArgs<IPin>>

PinDisconnected

Occurs when the pin disconnects from another pin

public event EventHandler<SingleValueEventArgs<IPin>>? PinDisconnected

Event Type

EventHandler<SingleValueEventArgs<IPin>>