Skip to content

Commit 8a6a279

Browse files
committed
Added disableAll() and defaults() to Settings
1 parent 2cc0b63 commit 8a6a279

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

TBA-API/src/com/cpjd/main/Settings.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,26 @@ public static void useAPIV3(boolean b) {
7575
* Default: false
7676
*/
7777
public static boolean GET_EVENT_WEBCASTS = false;
78+
79+
/**
80+
* Sets all the configuration settings to their defaults.
81+
*/
82+
public static void defaults() {
83+
disableAll();
84+
GET_EVENT_TEAMS = true;
85+
GET_EVENT_MATCHES = true;
86+
}
87+
88+
/**
89+
* Disables all the settings.
90+
*/
91+
public static void disableAll() {
92+
GET_EVENT_TEAMS = false;
93+
GET_EVENT_AWARDS = false;
94+
GET_EVENT_MATCHES = false;
95+
GET_EVENT_ALLIANCES = false;
96+
GET_EVENT_STATS = false;
97+
FIND_TEAM_RANKINGS = false;
98+
GET_EVENT_WEBCASTS = false;
99+
}
78100
}

TBA-API/src/com/cpjd/models/Match.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ public int compareTo(Match o) {
6666
else if(o.comp_level.equals("f")) compareScore += 100000;
6767
compareScore += o.match_number;
6868

69-
7069
return Long.compare(localScore, compareScore);
7170
}
7271
}

TBA-API/src/com/cpjd/requests/TeamRequest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,4 +199,6 @@ public Team fillOPR(Event event, Team team) {
199199
return new Parser().parseOPR(event, team);
200200
}
201201

202+
203+
202204
}

TBA-API/src/com/cpjd/utils/Parser.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ public Team parseOPR(Event event, Team team) {
239239
return team;
240240
}
241241

242+
243+
242244
public Event parseEventStats(Event event) throws Exception {
243245
JSONObject obj = (JSONObject) IO.doRequest(Constants.URL + "event/" + event.year + event.key.replace(String.valueOf(event.year), "") + "/stats", Constants.APPID);
244246
JSONObject obj2 = (JSONObject) obj.get("oprs");

0 commit comments

Comments
 (0)