Package net.commoble.exmachina.api

# Interface Channel

All Known Implementing Classes:
  `Channel.Redstone`, `Channel.Single`

public sealed interface Channel permits Channel.Redstone, Channel.Single

Channels are used by the signal graph to keep signals separate from each other.

There are seventeen channels: one for each dye color, plus the redstone channel.

The redstone channel can connect to any channel, while the color channels can only connect to the same channel or to redstone.

## Nested Class Summary

Nested Classes
Modifier and Type
Interface
Description
`static enum`
`Channel.Redstone`
The Redstone Channel
`static final record`
`Channel.Single`
Single channels represent one of the sixteen-color digital channels

## Field Summary

Fields
Modifier and Type
Field
Description
`static final Set<Channel>`
`ALL`
Set of all channels including the sixteen color channels and redstone
`static final com.mojang.serialization.Codec<Channel>`
`CODEC`
Codec which parses a string at a channel, can be "redstone" or any `DyeColor`, e.g.
`static final List<Set<Channel>>`
`EXPANDED_SINGLES`
List of each of the color channels' connectable sets, indexed by color ordinal e.g.
`static final Set<Channel>`
`SIXTEEN_COLORS`
Set of the sixteen color-channels

## Method Summary

Modifier and Type
Method
Description
`Set<Channel>`
`getConnectableChannels()`
Returns Set of Channels this channel can connect to.
`static com.mojang.serialization.DataResult<Channel>`
`parse(String s)`
Attempts to parse a Channel as a String
`static Channel`
`redstone()`
Returns the Redstone channel.
`static Channel`
`single(net.minecraft.world.item.DyeColor color)`
Retrieves the color channel for a given DyeColor.

## Field Details

### CODEC

static final com.mojang.serialization.Codec<Channel> CODEC
Codec which parses a string at a channel, can be "redstone" or any `DyeColor`, e.g. "white", "orange"

### SIXTEEN_COLORS

static final Set<Channel> SIXTEEN_COLORS
Set of the sixteen color-channels

### ALL

static final Set<Channel> ALL
Set of all channels including the sixteen color channels and redstone

### EXPANDED_SINGLES

static final List<Set<Channel>> EXPANDED_SINGLES
List of each of the color channels' connectable sets, indexed by color ordinal e.g. [{redstone,white}, {redstone,orange}, etc]

## Method Details

### getConnectableChannels

Set<Channel> getConnectableChannels()
Returns Set of Channels this channel can connect to.

Returns:
  Set of Channels this channel can connect to

### redstone

static Channel redstone()
Returns the Redstone channel.

Returns:
  the Redstone channel

### single

static Channel single(net.minecraft.world.item.DyeColor color)
Retrieves the color channel for a given DyeColor.

Parameters:
  `color` - DyeColor of a channel to retrieve
Returns:
  the Channel for the given DyeColor

### parse

static com.mojang.serialization.DataResult<Channel> parse(String s)
Attempts to parse a Channel as a String

Parameters:
  `s` - String representation of a channel, e.g. "redstone", "white", "orange"
Returns:
  Success result if string is parsable as a channel, error result otherwise