Solved 3.2.2
This commit is contained in:
parent
b6ba4e7c3b
commit
97f592598b
1 changed files with 341 additions and 315 deletions
|
|
@ -151,7 +151,33 @@ public class Resources {
|
||||||
* @see #addScoreEntry(ScoreEntry)
|
* @see #addScoreEntry(ScoreEntry)
|
||||||
*/
|
*/
|
||||||
private void loadScoreEntries() {
|
private void loadScoreEntries() {
|
||||||
// TODO: Resources#loadScoreEntries()
|
|
||||||
|
List<ScoreEntry> regionNames = new LinkedList<>();
|
||||||
|
InputStream is = Resources.class.getClassLoader().getResourceAsStream("highscores.txt");
|
||||||
|
InputStreamReader isr = new InputStreamReader(is, StandardCharsets.UTF_8);
|
||||||
|
BufferedReader br = new BufferedReader(isr);
|
||||||
|
ScoreEntry temp;
|
||||||
|
scoreEntries = new LinkedList<>();
|
||||||
|
String line;
|
||||||
|
try {
|
||||||
|
while((line = br.readLine()) != null) {
|
||||||
|
line = line.trim();
|
||||||
|
if(line.length() > 0 && !line.startsWith("#")) {
|
||||||
|
temp = ScoreEntry.read(line);
|
||||||
|
scoreEntries.add(temp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Collections.sort(scoreEntries, new Comparator<ScoreEntry>() {
|
||||||
|
@Override
|
||||||
|
public int compare(ScoreEntry s1, ScoreEntry s2) {
|
||||||
|
return s1.compareTo(s2);
|
||||||
|
} } );
|
||||||
|
|
||||||
|
br.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue