private Object interpretSensor(Sprite sprite) {
   Sensors sensor = Sensors.getSensorByValue(value);
   if (sensor.isObjectSensor) {
     return interpretObjectSensor(sensor, sprite);
   } else {
     return SensorHandler.getSensorValue(sensor);
   }
 }
  public int getRequiredResources() {
    int resources = Brick.NO_RESOURCES;
    if (leftChild != null) {
      resources |= leftChild.getRequiredResources();
    }
    if (rightChild != null) {
      resources |= rightChild.getRequiredResources();
    }
    if (type == ElementType.FUNCTION) {
      Functions functions = Functions.getFunctionByValue(value);
      switch (functions) {
        case ARDUINOANALOG:
        case ARDUINODIGITAL:
          resources |= Brick.BLUETOOTH_SENSORS_ARDUINO;
          break;
        case RASPIDIGITAL:
          resources |= Brick.SOCKET_RASPI;
          break;
      }
    }
    if (type == ElementType.SENSOR) {
      Sensors sensor = Sensors.getSensorByValue(value);
      switch (sensor) {
        case X_ACCELERATION:
        case Y_ACCELERATION:
        case Z_ACCELERATION:
          resources |= Brick.SENSOR_ACCELERATION;
          break;

        case X_INCLINATION:
        case Y_INCLINATION:
          resources |= Brick.SENSOR_INCLINATION;
          break;

        case COMPASS_DIRECTION:
          resources |= Brick.SENSOR_COMPASS;
          break;

        case LATITUDE:
        case LONGITUDE:
        case LOCATION_ACCURACY:
        case ALTITUDE:
          resources |= Brick.SENSOR_GPS;
          break;

        case FACE_DETECTED:
        case FACE_SIZE:
        case FACE_X_POSITION:
        case FACE_Y_POSITION:
          resources |= Brick.FACE_DETECTION;
          break;

        case NXT_SENSOR_1:
        case NXT_SENSOR_2:
        case NXT_SENSOR_3:
        case NXT_SENSOR_4:
          resources |= Brick.BLUETOOTH_LEGO_NXT;
          break;

        case PHIRO_FRONT_LEFT:
        case PHIRO_FRONT_RIGHT:
        case PHIRO_SIDE_LEFT:
        case PHIRO_SIDE_RIGHT:
        case PHIRO_BOTTOM_LEFT:
        case PHIRO_BOTTOM_RIGHT:
          resources |= Brick.BLUETOOTH_PHIRO;
          break;

        case DRONE_BATTERY_STATUS:
        case DRONE_CAMERA_READY:
        case DRONE_EMERGENCY_STATE:
        case DRONE_FLYING:
        case DRONE_INITIALIZED:
        case DRONE_NUM_FRAMES:
        case DRONE_RECORD_READY:
        case DRONE_RECORDING:
        case DRONE_USB_ACTIVE:
        case DRONE_USB_REMAINING_TIME:
          resources |= Brick.ARDRONE_SUPPORT;
          break;

        case NFC_TAG_ID:
          resources |= Brick.NFC_ADAPTER;
          break;

        default:
      }
    }
    if (type == ElementType.COLLISION_FORMULA) {
      resources |= Brick.COLLISION;
    }
    return resources;
  }