Major refactoring - now using far more logical class names.

- Renamed "OsuFile" to "Beatmap".  All related variables and methods with "osu" have also been renamed to "beatmap" (or variants of each).
- Renamed "OsuGroupNode" to "BeatmapSetNode".  Avoids confusion since groups are identified by a "set ID", not a "group ID".
- Renamed "OsuGroupList" to "BeatmapSetList", for the same reason as above.
- Renamed "OsuDB" to "BeatmapDB", for the same reason as above.
- Moved classes directly related to parsed beatmaps (Beatmap, BeatmapSetList, BeatmapSetNode, OsuHitObject, and TimingPoint) into a new "beatmap" package.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-05-16 21:25:19 -04:00
parent 0a80590505
commit 53c79c5d85
36 changed files with 786 additions and 761 deletions

View File

@@ -19,6 +19,7 @@
package itdelatrisu.opsu;
import itdelatrisu.opsu.audio.MusicController;
import itdelatrisu.opsu.beatmap.Beatmap;
import java.io.BufferedReader;
import java.io.BufferedWriter;
@@ -63,7 +64,7 @@ public class Options {
};
/** Cached beatmap database name. */
public static final File OSU_DB = new File(DATA_DIR, ".opsu.db");
public static final File BEATMAP_DB = new File(DATA_DIR, ".opsu.db");
/** Score database name. */
public static final File SCORE_DB = new File(DATA_DIR, ".opsu_scores.db");
@@ -866,28 +867,28 @@ public class Options {
}
/**
* Returns a dummy OsuFile containing the theme song.
* @return the theme song OsuFile
* Returns a dummy Beatmap containing the theme song.
* @return the theme song beatmap
*/
public static OsuFile getOsuTheme() {
public static Beatmap getThemeBeatmap() {
String[] tokens = themeString.split(",");
if (tokens.length != 4) {
ErrorHandler.error("Theme song string is malformed.", null, false);
return null;
}
OsuFile osu = new OsuFile(null);
osu.audioFilename = new File(tokens[0]);
osu.title = tokens[1];
osu.artist = tokens[2];
Beatmap beatmap = new Beatmap(null);
beatmap.audioFilename = new File(tokens[0]);
beatmap.title = tokens[1];
beatmap.artist = tokens[2];
try {
osu.endTime = Integer.parseInt(tokens[3]);
beatmap.endTime = Integer.parseInt(tokens[3]);
} catch (NumberFormatException e) {
ErrorHandler.error("Theme song length is not a valid integer", e, false);
return null;
}
return osu;
return beatmap;
}
/**