Skip to content
Snippets Groups Projects
Commit c95b25f2 authored by ivarnm's avatar ivarnm
Browse files

#69 Add doRoundCheck

parent 1257efc9
No related branches found
No related tags found
1 merge request!64Resolve "Add round check method in QI"
...@@ -14,6 +14,7 @@ import com.gameware.game.models.Highscore; ...@@ -14,6 +14,7 @@ import com.gameware.game.models.Highscore;
import com.gameware.game.models.Player; import com.gameware.game.models.Player;
import com.gameware.game.models.Point; import com.gameware.game.models.Point;
import com.gameware.game.models.Round; import com.gameware.game.models.Round;
import com.gameware.game.models.RoundCheck;
import com.gameware.game.models.Tournament; import com.gameware.game.models.Tournament;
import java.io.IOException; import java.io.IOException;
...@@ -209,12 +210,13 @@ public class QueryIntermediate { ...@@ -209,12 +210,13 @@ public class QueryIntermediate {
return points; 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 route = "tournament/roundcheck/" + tournamentId;
String[] response = sendPutRequest(route, null); String[] response = sendPutRequest(route, null);
checkStatusCode(response); checkStatusCode(response);
System.out.println(response); RoundCheck roundCheck = json.fromJson(RoundCheck.class, response[1]);
return null; checkObjectNotNull(roundCheck);
return roundCheck;
} }
// ---------------- Highscore methods ---------------- // ---------------- Highscore methods ----------------
......
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();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment