diff --git a/frontend/core/src/com/gameware/game/QueryIntermediate.java b/frontend/core/src/com/gameware/game/QueryIntermediate.java index 0cd5c59f9c53d9180966db73581e4a396d115949..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; @@ -209,12 +210,13 @@ public class QueryIntermediate { return points; } - public static Tournament doRoundCheck(String tournamentId) throws IOException, NoSuchElementException { + public static RoundCheck doRoundCheck(String tournamentId) throws IOException, NoSuchElementException { String route = "tournament/roundcheck/" + tournamentId; String[] response = sendPutRequest(route, null); checkStatusCode(response); - System.out.println(response); - return null; + RoundCheck roundCheck = json.fromJson(RoundCheck.class, response[1]); + checkObjectNotNull(roundCheck); + return roundCheck; } // ---------------- Highscore methods ---------------- 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(); + } +}