Skip to content
Snippets Groups Projects
Commit e028ed95 authored by Ivar Nordvik Myrstad's avatar Ivar Nordvik Myrstad
Browse files

Merge branch '69-add-round-check-method-in-qi' into 'dev'

Resolve "Add round check method in QI"

Closes #69

See merge request !64
parents 1ca2f4ae c95b25f2
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;
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");
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;
......
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