Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/com/cpjd/requests/EventRequest.java
  • Loading branch information
widavies committed Feb 5, 2018
2 parents a39a78a + 85290b4 commit 277ac0e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules/TBA-API-V3.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/main/java/com/cpjd/models/simple/SMatch.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @author Will Davies
*/
@Data
public class SMatch implements Serializable, Comparable<Match> {
public class SMatch implements Serializable, Comparable<SMatch> {
/**
* TBA event key with the format yyyy[EVENT_CODE]_[COMP_LEVEL]m[MATCH_NUMBER], where yyyy is the year, and EVENT_CODE is the event code of the event, COMP_LEVEL is (qm, ef, qf, sf, f), and MATCH_NUMBER is the match number in the competition level. A set number may append the competition level if more than one match in required per set.
*
Expand Down Expand Up @@ -67,7 +67,7 @@ public class SMatch implements Serializable, Comparable<Match> {
*/

@Override
public int compareTo(Match o) {
public int compareTo(SMatch o) {
long localScore = matchNumber;
if(compLevel.equals("qf")) localScore += 1000;
else if(compLevel.equals("sf")) localScore += 10000;
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/cpjd/utils/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,11 @@ protected Match parseMatch(Object object) {
JSONObject allies = (JSONObject) hash.get("alliances");
if(allies != null) {
JSONObject blue = (JSONObject) allies.get("blue");
JSONObject red = (JSONObject) allies.get("blue");
JSONObject red = (JSONObject) allies.get("red");
MatchAlliance redAlly = new MatchAlliance();
MatchAlliance blueAlly = new MatchAlliance();
redAlly.setScore(Utils.cleanLong(red.get("score")));
blueAlly.setScore(Utils.cleanLong(blue.get("score")));
JSONArray redTeamKeys = (JSONArray) red.get("team_keys");
JSONArray blueTeamKeys = (JSONArray) blue.get("team_keys");
redAlly.setTeamKeys(Utils.jsonArrayToStringArray(redTeamKeys));
Expand Down Expand Up @@ -231,10 +232,11 @@ protected SMatch parseSMatch(Object object) {
JSONObject allies = (JSONObject) hash.get("alliances");
if(allies != null) {
JSONObject blue = (JSONObject) allies.get("blue");
JSONObject red = (JSONObject) allies.get("blue");
JSONObject red = (JSONObject) allies.get("red");
MatchAlliance redAlly = new MatchAlliance();
MatchAlliance blueAlly = new MatchAlliance();
redAlly.setScore(Utils.cleanLong(red.get("score")));
blueAlly.setScore(Utils.cleanLong(blue.get("score")));
JSONArray redTeamKeys = (JSONArray) red.get("team_keys");
JSONArray blueTeamKeys = (JSONArray) blue.get("team_keys");
redAlly.setTeamKeys(Utils.jsonArrayToStringArray(redTeamKeys));
Expand Down

0 comments on commit 277ac0e

Please sign in to comment.