project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/MapFile.java
equal
deleted
inserted
replaced
47 |
47 |
48 /** |
48 /** |
49 * @throws FileNotFoundException if the sdcard is not available. Does NOT throw if the requested map file does not exist. |
49 * @throws FileNotFoundException if the sdcard is not available. Does NOT throw if the requested map file does not exist. |
50 */ |
50 */ |
51 public static File getFileForMapname(Context ctx, String mapname) throws FileNotFoundException { |
51 public static File getFileForMapname(Context ctx, String mapname) throws FileNotFoundException { |
52 return new File(new File(FileUtils.getDataPathFile(ctx), MAP_DIRECTORY), mapname); |
52 return FileUtils.getDataPathFile(ctx, MAP_DIRECTORY, mapname); |
53 } |
53 } |
54 |
54 |
55 public static final Comparator<MapFile> MISSIONS_FIRST_NAME_ORDER = new Comparator<MapFile>() { |
55 public static final Comparator<MapFile> MISSIONS_FIRST_NAME_ORDER = new Comparator<MapFile>() { |
56 public int compare(MapFile lhs, MapFile rhs) { |
56 public int compare(MapFile lhs, MapFile rhs) { |
57 if(lhs.isMission != rhs.isMission) { |
57 if(lhs.isMission != rhs.isMission) { |
70 public File getPreviewFile(Context c) throws FileNotFoundException { |
70 public File getPreviewFile(Context c) throws FileNotFoundException { |
71 return getPreviewFile(c, name); |
71 return getPreviewFile(c, name); |
72 } |
72 } |
73 |
73 |
74 public static File getPreviewFile(Context c, String mapName) throws FileNotFoundException { |
74 public static File getPreviewFile(Context c, String mapName) throws FileNotFoundException { |
75 return new File(FileUtils.getDataPathFile(c), MAP_DIRECTORY + "/" + mapName + "/" + "preview.png"); |
75 return FileUtils.getDataPathFile(c, MAP_DIRECTORY, mapName, "preview.png"); |
76 } |
76 } |
77 |
77 |
78 public static List<String> toDisplayNameList(List<MapFile> mapFiles, Resources res) { |
78 public static List<String> toDisplayNameList(List<MapFile> mapFiles, Resources res) { |
79 String missionPrefix = res.getString(R.string.map_mission_prefix); |
79 String missionPrefix = res.getString(R.string.map_mission_prefix); |
80 List<String> result = new ArrayList<String>(); |
80 List<String> result = new ArrayList<String>(); |