Skip to content

Commit

Permalink
Added star difficulty to conditional search filters.
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
  • Loading branch information
itdelatrisu committed Sep 4, 2015
1 parent 3214916 commit 1494884
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/itdelatrisu/opsu/beatmap/BeatmapSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ public boolean matches(String type, String operator, float value) {
case "hp": v = beatmap.HPDrainRate; break;
case "bpm": v = beatmap.bpmMax; break;
case "length": v = beatmap.endTime / 1000; break;
case "star":
case "stars": v = Math.round(beatmap.starRating * 100) / 100f; break;
default: return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/itdelatrisu/opsu/beatmap/BeatmapSetList.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class BeatmapSetList {

/** Search pattern for conditional expressions. */
private static final Pattern SEARCH_CONDITION_PATTERN = Pattern.compile(
"(ar|cs|od|hp|bpm|length)(=|==|>|>=|<|<=)((\\d*\\.)?\\d+)"
"(ar|cs|od|hp|bpm|length|stars?)(=|==|>|>=|<|<=)((\\d*\\.)?\\d+)"
);

/** List containing all parsed nodes. */
Expand Down

0 comments on commit 1494884

Please # to comment.