Ejemplo n.º 1
0
 /**
  * Converts map data from String to ArrayList<String>, which represents warp map names.
  *
  * @param contents : String data from file.
  * @param warpNames : ArrayList to store names.
  * @return : Leftover String data.
  */
 public static String readMapData3(String contents, ArrayList<String> warpNames) throws Exception {
   try {
     int delimit = breakPoint(contents, 1, '\n');
     String line = contents.substring(0, delimit - 1);
     contents = contents.substring(delimit + 1);
     if (line.equals("null")) {
       return contents;
     }
     int start = 0;
     for (int index = 0; index < line.length(); ++index) {
       if (line.charAt(index) == ' ') {
         warpNames.add(line.substring(start, index));
         start = index + 1;
       }
     }
     warpNames.add(line.substring(start));
     MapMaker.setMapData3(warpNames);
     return contents;
   } catch (Exception e) {
     e.printStackTrace();
     throw new Exception("Cannot read warp name data.");
   }
 }