Esempio n. 1
0
  /**
   * UI method - sets the driving model
   *
   * @param p_data input data
   */
  private final void web_static_setdrivemodel(final Map<String, Object> p_data) {
    if (CSimulation.getInstance().isRunning())
      throw new IllegalStateException(CCommon.getResourceString(this, "running"));
    if (!p_data.containsKey("id"))
      throw new IllegalArgumentException(CCommon.getResourceString(this, "nomodelname"));

    CSimulation.getInstance()
        .getWorld()
        .<CCarLayer>getTyped("Cars")
        .setDriveModel(CCarLayer.EDrivingModel.valueOf((String) p_data.get("id")));
  }