WIPTest Merge Fixes

This commit is contained in:
fd
2015-06-13 21:16:27 -04:00
parent fd3f7fdabe
commit 038a5d5779
18 changed files with 75 additions and 3687 deletions

View File

@@ -184,7 +184,10 @@ public class Beatmap implements Comparable<Beatmap> {
/** Slider border color. If null, the skin value is used. */
public Color sliderBorder;
/** md5 hash of this file */
public String md5Hash;
/**
* [HitObjects]
*/

View File

@@ -589,6 +589,8 @@ public class BeatmapParser {
// parse hit objects now?
if (parseObjects)
parseHitObjects(beatmap);
beatmap.md5Hash = Utils.getMD5(file);
return beatmap;
}

View File

@@ -28,6 +28,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
@@ -57,6 +58,10 @@ public class BeatmapSetList {
/** Set of all beatmap set IDs for the parsed beatmaps. */
private HashSet<Integer> MSIDdb;
/** Map of all hash to Beatmap . */
public HashMap<String, Beatmap> beatmapHashesToFile;
/** Index of current expanded node (-1 if no node is expanded). */
private int expandedIndex;
@@ -83,6 +88,7 @@ public class BeatmapSetList {
private BeatmapSetList() {
parsedNodes = new ArrayList<BeatmapSetNode>();
MSIDdb = new HashSet<Integer>();
beatmapHashesToFile = new HashMap<String, Beatmap>();
reset();
}
@@ -117,6 +123,10 @@ public class BeatmapSetList {
int msid = beatmaps.get(0).beatmapSetID;
if (msid > 0)
MSIDdb.add(msid);
for(Beatmap f : beatmaps) {
beatmapHashesToFile.put(f.md5Hash, f);
}
return node;
}
@@ -501,4 +511,8 @@ public class BeatmapSetList {
* @return true if id is in the list
*/
public boolean containsBeatmapSetID(int id) { return MSIDdb.contains(id); }
public Beatmap getFileFromBeatmapHash(String beatmapHash) {
return beatmapHashesToFile.get(beatmapHash);
}
}