2 * Copyright (c) 2019-2020. Developed by Hedgecode.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.hedgecode.chess.scanner.json.chessbomb;
19 import java.util.ArrayList;
20 import java.util.List;
22 import com.google.gson.annotations.SerializedName;
24 import org.hedgecode.chess.scanner.format.chessbomb.Game;
25 import org.hedgecode.chess.scanner.format.chessbomb.RoomData;
26 import org.hedgecode.chess.scanner.format.chessbomb.TournamentFormat;
29 * JSONTournamentFormat
31 * @author Dmitry Samoshin aka gotty
33 public class JSONTournamentFormat extends AbstractBaseFormat implements TournamentFormat {
35 private static final String GAME_URL_FORMAT = "%s-%s";
37 @SerializedName("roomData")
38 private JSONRoomData roomData;
40 JSONTournamentFormat() {
45 return Integer.toString(
46 roomData().room().id()
51 public String name() {
52 return roomData().room().name();
56 public RoomData roomData() {
61 public List<String> gameUrls() {
62 List<String> gameUrls = new ArrayList<>();
63 for (Game game : roomData.games()) {
65 String.format(GAME_URL_FORMAT, game.roundSlug(), game.slug())