Skip to content

[Api] Base Ports

CoffeeVampir3 edited this page Mar 29, 2021 · 3 revisions
public abstract class BasePort

All other ports inherit from Base Port and thus share the same base API.

public List<Link> Links => links;

Returns the list of all links belonging to this port.

public RuntimeNode FirstNode()
{
    return links.Count > 0 ? links[0].Node : null;
}

Returns the first link's node or null. Best practice is to use these first functions only on ports using Capacity.Single since they are guaranteed to only have one link at most. Don't use first functions on Dynamic Ports.

public Link FirstLink()
{
    return links.Count > 0 ? links[0] : null;
}

Returns the first link or null. Best practice is to use these first functions only on ports using Capacity.Single since they are guaranteed to only have one link at most. Don't use first functions on Dynamic Ports.

public bool IsLinked()
{
    return links.Count > 0;
}
public bool HasMultipleLinks()
{
    return links.Count > 1;
}