Initial replay parsing support.
- Basic implementation of viewing replays in the Game state. - Added OsuReader class for reading certain osu! file types. (author: Markus Jarderot) - Added Replay, ReplayFrame, and LifeFrame classes to capture replay data. (author: smoogipooo) - Added 'keyPressed' parameter to HitObject.update(). - Added cursor-drawing methods in UI that take the mouse coordinates and pressed state as parameters. - Added GameMod methods to retrieve/load the active mods state as a bitmask. - Added Apache commons-compress dependency for handling LZMA decompression. Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
This commit is contained in:
@@ -213,6 +213,27 @@ public enum GameMod {
|
||||
return scoreMultiplier;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current game mod state (bitwise OR of active mods).
|
||||
*/
|
||||
public static int getModState() {
|
||||
int state = 0;
|
||||
for (GameMod mod : GameMod.values()) {
|
||||
if (mod.isActive())
|
||||
state |= mod.getBit();
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the active states of all game mods to the given state.
|
||||
* @param state the state (bitwise OR of active mods)
|
||||
*/
|
||||
public static void loadModState(int state) {
|
||||
for (GameMod mod : GameMod.values())
|
||||
mod.active = ((state & mod.getBit()) > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param category the category for the mod
|
||||
|
||||
Reference in New Issue
Block a user