Interface Connectable

All Known Implementing Classes:
Connector, ConnectorBridge, ConnectorRelay, ConnectorSink, ConnectorSource

public interface Connectable
  • Field Details

    • defaultConnectionDirections

      static final Types.IntVector2[] defaultConnectionDirections
  • Method Details

    • propagate

      void propagate(GameContext ctx, HashSet<Integer> seen)
      Potentially propagate the the connectors current siganl
      Parameters:
      seen - is IDs of all Connectable items which have already propagated
    • connectionDirections

      default Types.IntVector2[] connectionDirections()
      By default, connectable items connect visually to 8 directions. ^ ^ ^ ^ me ^ ^ ^ ^ Override this method to change visual connection directions
    • acceptSignalFrom

      void acceptSignalFrom(Connectable source, Types.IntVector2 pos, GameContext ctx, HashSet<Integer> seen)
      Called when this Connectable receives a signal from another.
      Parameters:
      source - the Connectable sending the signal
      pos - the source's position
      seen - A set of already visited IDs
    • setActive

      void setActive(boolean connected, GameContext ctx)
      Set the Connectable to be connected This may or may not propagate the signal
    • getConnectorType

      Connector.ConnectorType getConnectorType()
      Get the type of connector.
    • isConnected

      boolean isConnected()
      Get whether or not this Connectable is connected (active)