Skip to content

Network API

Ruben Taelman edited this page Sep 18, 2016 · 2 revisions

The Integrated Dynamics network API is split up into 4 levels: path, cable, network, part

Path

This level uses the IPathElement capability to indicate which blocks can connect with other blocks. The PathFinder class is able to find a connected cluster given a starting IPathElement.

Cable

Cables, with the ICable capability, are a form of persistent paths. By default, the PathElementCable IPathElement capability should be available for cables. The ICable capability is used to store connections that are formed after pathfinding.

An optional ICableFakeable capability is available which makes it possible to mark a cable as being 'fake', while that block is still present, but just hidden. This is useful when the cable is the main block owner, and other parts could be present on the cable that do not necessarily require this cable to be present.

Network

INetworkCarrier is a capability for blocks that can hold a network. INetworkElementProvider is a capability for blocks that can provide INetworkElement's. A INetworkElement is an element that can be added to a network, and receives events.

Part

A IPartContainer capability can hold parts. A part is identified by IPartType's with IPartState's. IPartType's are singletons for part type. IPartState's are instantiations of parts, so multiple states can exist for each part.

Combined

In Integrated Dynamics, these 4 levels come together. Cables have IPathElement, ICable, INetworkCarrier, INetworkElementProvider and IPartContainer capabilities. The INetworkElementProvider provides PartNetworkElement for each part that is available in the part container.