Skip to content

Commit

Permalink
Added filters and 'submitted' to scores
Browse files Browse the repository at this point in the history
  • Loading branch information
benlowry committed Jun 12, 2013
1 parent 2804ecc commit e3a3c54
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Playtomic/src/com/playtomic/android/PlayerScore.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ public JSONObject fields() {

return optJSONObject("fields");
}

public JSONObject filters() {

if(!has("filters")) {
setValue("filters", new JSONObject());
}

return optJSONObject("filters");
}

public void setField(String name, Object value) {
if(!has("fields")) {
Expand All @@ -81,6 +90,18 @@ public void setField(String name, Object value) {

}
}

public void setFilter(String name, Object value) {
if(!has("filters")) {
setValue("filters", new JSONObject());
}

try {
filters().put(name, value);
} catch(JSONException err) {

}
}

public String getRDate() {
return optString("rdate", "Just now");
Expand Down Expand Up @@ -116,6 +137,10 @@ public void setHighest() {
public void setLowest() {
setValue("highest", false);
}

public boolean getSubmitted() {
return optBoolean("submitted", false);
}

public void setPerPage(int perpage) {
setValue("perpage", perpage);
Expand Down

0 comments on commit e3a3c54

Please sign in to comment.