diff --git a/frontend/core/src/com/gameware/game/QueryIntermediate.java b/frontend/core/src/com/gameware/game/QueryIntermediate.java index 288755e382df8d16921d207b1562aaefc6cd9c99..d27987f07c1a4331d0f99e16962f71661f8cf727 100644 --- a/frontend/core/src/com/gameware/game/QueryIntermediate.java +++ b/frontend/core/src/com/gameware/game/QueryIntermediate.java @@ -14,6 +14,7 @@ import com.gameware.game.models.Highscore; import com.gameware.game.models.Player; import com.gameware.game.models.Point; import com.gameware.game.models.Round; +import com.gameware.game.models.RoundCheck; import com.gameware.game.models.Tournament; import java.io.IOException; @@ -54,7 +55,9 @@ public class QueryIntermediate { HttpRequest httpPut = new HttpRequest(HttpMethods.PUT); httpPut.setUrl(baseUrl + route); httpPut.setHeader("Content-Type", "application/x-www-form-urlencoded"); - httpPut.setContent(HttpParametersUtils.convertHttpParameters(params)); + if (params != null) { + httpPut.setContent(HttpParametersUtils.convertHttpParameters(params)); + } return sendRequest(httpPut); } @@ -207,6 +210,15 @@ public class QueryIntermediate { return points; } + public static RoundCheck doRoundCheck(String tournamentId) throws IOException, NoSuchElementException { + String route = "tournament/roundcheck/" + tournamentId; + String[] response = sendPutRequest(route, null); + checkStatusCode(response); + RoundCheck roundCheck = json.fromJson(RoundCheck.class, response[1]); + checkObjectNotNull(roundCheck); + return roundCheck; + } + // ---------------- Highscore methods ---------------- public static List<Highscore> getHighscoresForGame(String gameId) throws IOException, NoSuchElementException { String route = "highscores/gamescores/" + gameId; diff --git a/frontend/core/src/com/gameware/game/models/RoundCheck.java b/frontend/core/src/com/gameware/game/models/RoundCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..fb0da2900028f20033199149a4718754745b88d2 --- /dev/null +++ b/frontend/core/src/com/gameware/game/models/RoundCheck.java @@ -0,0 +1,33 @@ +package com.gameware.game.models; + +import com.badlogic.gdx.utils.Json; + +public class RoundCheck implements ModelInterface { + private boolean active; + private boolean nextRound; + + public RoundCheck() { + } + + public boolean isActive() { + return active; + } + + public boolean isNextRound() { + return nextRound; + } + + @Override + public void reset() { + active = false; + nextRound = false; + } + + @Override + public String report() {return new Json().toJson(this);} + + @Override + public String toString() { + return report(); + } +}