Example #1
0
 /**
  * Reads the OK map node types from settings
  *
  * @param settings The settings where the types are read
  */
 private void readOkMapNodeTypes(Settings settings) {
   if (settings.contains(MAP_SELECT_S)) {
     this.okMapNodeTypes = settings.getCsvInts(MAP_SELECT_S);
     for (int i : okMapNodeTypes) {
       if (i < MapNode.MIN_TYPE || i > MapNode.MAX_TYPE) {
         throw new SettingsError(
             "Map type selection '"
                 + i
                 + "' is out of range for setting "
                 + settings.getFullPropertyName(MAP_SELECT_S));
       }
       if (i > nrofMapFilesRead) {
         throw new SettingsError(
             "Can't use map type selection '"
                 + i
                 + "' for setting "
                 + settings.getFullPropertyName(MAP_SELECT_S)
                 + " because only "
                 + nrofMapFilesRead
                 + " map files are read");
       }
     }
   } else {
     this.okMapNodeTypes = null;
   }
 }