Exemplo n.º 1
0
  @Override
  public void setValue(Agent a, float value) {
    Object state = getParamObject(a);
    if (state == null) return;

    if (propertyAccessor.getType().equals(float.class)) {
      propertyAccessor.set(state, value);
    } else if (propertyAccessor.getType().equals(int.class)) {
      propertyAccessor.set(state, Math.round(value));
    } else {
      throw new IllegalArgumentException("Field is not one of the acceptible types");
    }
  }