import org.hedgecode.snooker.api.Players;
import org.hedgecode.snooker.api.RankingType;
import org.hedgecode.snooker.api.Rankings;
+import org.hedgecode.snooker.api.Rounds;
import org.hedgecode.snooker.api.Season;
+import org.hedgecode.snooker.api.Seedings;
import org.hedgecode.snooker.api.SnookerScoreAPI;
import org.hedgecode.snooker.gson.SnookerGsonBuilder;
import org.hedgecode.snooker.request.RequestException;
}
@Override
+ public Rounds getEventRounds(int eventId) throws APIException {
+ Rounds rounds;
+ try {
+ rounds = new JsonRounds(
+ GSON.fromJson(
+ JsonStringToken.token(
+ RequestType.request(
+ RequestType.EVENT_ROUNDS,
+ eventId
+ )
+ ),
+ JsonRound[].class
+ )
+ );
+ } catch (RequestException e) {
+ throw new APIException(
+ APIException.Type.REQUEST, e.getMessage()
+ );
+ }
+ return rounds;
+ }
+
+ @Override
+ public Seedings getEventSeedings(int eventId) throws APIException {
+ Seedings seedings;
+ try {
+ seedings = new JsonSeedings(
+ GSON.fromJson(
+ JsonStringToken.token(
+ RequestType.request(
+ RequestType.EVENT_SEEDING,
+ eventId
+ )
+ ),
+ JsonSeeding[].class
+ )
+ );
+ } catch (RequestException e) {
+ throw new APIException(
+ APIException.Type.REQUEST, e.getMessage()
+ );
+ }
+ return seedings;
+ }
+
+ @Override
public void setCurrentSeason(Season season) throws APIException {
throw new APIException(
APIException.Type.INFO, "This feature is only available in Cached API"