Added a beatmap cache database.

- New database ".opsu.db" stores a cached copy of all parsed beatmaps.  All data will be read from this database unless the last modified time of a beatmap file does not match the one in the table.
- OsuParser inserts all new entries to the database in batch after parsing.
- Added *toString()/*fromString() methods for 'breaks', 'timingPoints', and 'combo' fields in OsuFile for use with the database.
- For any database format changes, update the DATABASE_VERSION field in OsuDB.
- Reloading beatmaps (F5) will now clear the beatmap cache.

Related changes:
- Added small DBController class for convenience.
- Changed 'bg' field of OsuFile to only contain the image file name, instead of the full path.
- Deleted printDatabase() method from ScoreDB.

Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han
2015-03-04 21:03:06 -05:00
parent 5626cd1699
commit bf04083ebd
12 changed files with 599 additions and 45 deletions

View File

@@ -61,6 +61,9 @@ public class Options {
new File(DATA_DIR, "Songs/").getPath()
};
/** Cached beatmap database name. */
public static final File OSU_DB = new File(DATA_DIR, ".opsu.db");
/** Score database name. */
public static final File SCORE_DB = new File(DATA_DIR, ".opsu_scores.db");