Пример #1
0
  public Color[] arduinoTies() {
    if (arduinoPiece == null
        || arduinoPiece == ArduinoToSliderBridge.nullSlider
        || arduinoPiece == ArduinoToPadBridge.nullPad
        || arduinoPiece.sensor() == null) {
      return null;
    }

    if (isHellaSlider) {
      Color[] ret = {Color.BLACK, Color.GRAY, Color.WHITE};
      return ret;
    }

    Color[] used = new Color[arduinoPiece.sensor().length];

    for (int i = 0; i < arduinoPiece.sensor().length; i++) {
      used[i] = CONNECTION_COLORS[arduinoPiece.sensor()[i]];
    }

    return used;
  }
Пример #2
0
 public boolean contains(ArduinoSensor sensor) {
   return arduinoPiece != null && arduinoPiece.contains(sensor);
 }