diff --git a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java index ae7e3f079b..56be4033ac 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/NewTournamentDialog.java @@ -276,7 +276,7 @@ public class NewTournamentDialog extends MageDialog { tOptions.setTournamentType(tournamentType.getName()); tOptions.getPlayerTypes().add("Human"); for (TournamentPlayerPanel player: players) { - tOptions.getPlayerTypes().add(player.getPlayerType()); + tOptions.getPlayerTypes().add((String) player.getPlayerType().getSelectedItem()); } if (tournamentType.isDraft()) { DraftOptions options = new DraftOptions(); @@ -347,12 +347,33 @@ public class NewTournamentDialog extends MageDialog { pack.setModel(new DefaultComboBoxModel(Sets.getInstance().values().toArray())); pnlPacks.add(pack); packs.add(pack); + pack.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + packActionPerformed(evt); + } + }); } this.pack(); this.revalidate(); this.repaint(); } + private void packActionPerformed(java.awt.event.ActionEvent evt) { + boolean start = false; + int selectedIndex = 0; + for (JComboBox pack: packs) { + if (!start) { + if (evt.getSource().equals(pack)) { + start = true; + selectedIndex = pack.getSelectedIndex(); + } + } + else { + pack.setSelectedIndex(selectedIndex); + } + } + } + private void createPlayers(int numPlayers) { if (numPlayers > players.size()) { while (players.size() != numPlayers) { @@ -373,12 +394,33 @@ public class NewTournamentDialog extends MageDialog { this.pnlOtherPlayers.removeAll(); for (TournamentPlayerPanel panel: players) { this.pnlOtherPlayers.add(panel); + panel.getPlayerType().addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + playerActionPerformed(evt); + } + }); } this.pack(); this.revalidate(); this.repaint(); } + private void playerActionPerformed(java.awt.event.ActionEvent evt) { + boolean start = false; + int selectedIndex = 0; + for (TournamentPlayerPanel player: players) { + if (!start) { + if (evt.getSource().equals(player.getPlayerType())) { + start = true; + selectedIndex = player.getPlayerType().getSelectedIndex(); + } + } + else { + player.getPlayerType().setSelectedIndex(selectedIndex); + } + } + } + public TableView getTable() { return table; } diff --git a/Mage.Client/src/main/java/mage/client/table/TournamentPlayerPanel.java b/Mage.Client/src/main/java/mage/client/table/TournamentPlayerPanel.java index d530406bdb..466b08bd09 100644 --- a/Mage.Client/src/main/java/mage/client/table/TournamentPlayerPanel.java +++ b/Mage.Client/src/main/java/mage/client/table/TournamentPlayerPanel.java @@ -36,6 +36,7 @@ package mage.client.table; import java.util.UUID; import javax.swing.DefaultComboBoxModel; +import javax.swing.JComboBox; import mage.client.MageFrame; import mage.client.remote.Session; @@ -59,8 +60,8 @@ public class TournamentPlayerPanel extends javax.swing.JPanel { this.lblPlayerNum.setText("Player " + playerNum); } - public String getPlayerType() { - return (String) this.cbPlayerType.getSelectedItem(); + public JComboBox getPlayerType() { + return this.cbPlayerType; } public boolean joinTournamentTable(UUID roomId, UUID tableId) { diff --git a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java index 3c1d67d5bc..9754d58fbe 100644 --- a/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java +++ b/Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human/HumanPlayer.java @@ -57,6 +57,7 @@ import mage.choices.ChoiceImpl; import mage.filter.common.FilterCreatureForCombat; import mage.game.Game; import mage.game.Table; +import mage.game.match.Match; import mage.game.permanent.Permanent; import mage.game.tournament.Tournament; import mage.target.Target; @@ -482,8 +483,8 @@ public class HumanPlayer extends PlayerImpl { } @Override - public void sideboard(Table table, Deck deck) { - table.fireSideboardEvent(playerId, deck); + public void sideboard(Match match, Deck deck) { + match.fireSideboardEvent(playerId, deck); } @Override diff --git a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/target/maven-archiver/pom.properties b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/target/maven-archiver/pom.properties deleted file mode 100644 index 2e014c18ee..0000000000 --- a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/target/maven-archiver/pom.properties +++ /dev/null @@ -1,5 +0,0 @@ -#Generated by Maven -#Sat Feb 12 11:24:53 MSK 2011 -version=0.6 -groupId=org.mage -artifactId=Mage-Tournament-BoosterDraft diff --git a/Mage.Server/plugins/mage-player-ai.jar b/Mage.Server/plugins/mage-player-ai.jar index 0d84511d77..5bdf67b3a4 100644 Binary files a/Mage.Server/plugins/mage-player-ai.jar and b/Mage.Server/plugins/mage-player-ai.jar differ diff --git a/Mage.Server/plugins/mage-player-human.jar b/Mage.Server/plugins/mage-player-human.jar index 049c58a1d7..4d68195bea 100644 Binary files a/Mage.Server/plugins/mage-player-human.jar and b/Mage.Server/plugins/mage-player-human.jar differ diff --git a/Mage.Server/src/main/java/mage/server/TableController.java b/Mage.Server/src/main/java/mage/server/TableController.java index 7f707e2ea6..ff58f76c09 100644 --- a/Mage.Server/src/main/java/mage/server/TableController.java +++ b/Mage.Server/src/main/java/mage/server/TableController.java @@ -66,7 +66,6 @@ import mage.game.match.MatchOptions; import mage.game.match.MatchPlayer; import mage.game.tournament.Tournament; import mage.game.tournament.TournamentOptions; -import mage.game.tournament.TournamentPlayer; import mage.players.Player; import mage.server.game.DeckValidatorFactory; import mage.server.game.GameFactory; @@ -85,15 +84,12 @@ public class TableController { private final static Logger logger = Logging.getLogger(TableController.class.getName()); - private static final int SIDEBOARD_TIME = 180; - private UUID sessionId; private UUID chatId; private Table table; private Match match; private MatchOptions options; private Tournament tournament; - private TournamentOptions tournamentOptions; private ConcurrentHashMap sessionPlayerMap = new ConcurrentHashMap(); public TableController(UUID sessionId, MatchOptions options) { @@ -108,24 +104,19 @@ public class TableController { public TableController(UUID sessionId, TournamentOptions options) { this.sessionId = sessionId; chatId = ChatManager.getInstance().createChatSession(); - this.tournamentOptions = options; tournament = TournamentFactory.getInstance().createTournament(options.getTournamentType(), options); table = new Table(options.getTournamentType(), options.getName(), DeckValidatorFactory.getInstance().createDeckValidator(options.getMatchOptions().getDeckType()), options.getPlayerTypes(), true); - init(); } private void init() { - table.addTableEventListener( + match.addTableEventListener( new Listener () { @Override public void event(TableEvent event) { switch (event.getEventType()) { case SIDEBOARD: - sideboard(event.getPlayerId(), event.getDeck()); + sideboard(event.getPlayerId(), event.getDeck(), event.getTimeout()); break; -// case CONSTRUCT: -// construct(event.getPlayerId(), event.getDeck()); -// break; case SUBMIT_DECK: submitDeck(event.getPlayerId(), event.getDeck()); break; @@ -209,8 +200,7 @@ public class TableController { private void submitDeck(UUID sessionId, Deck deck) { if (table.getState() == TableState.SIDEBOARDING) { - MatchPlayer player = match.getPlayer(sessionPlayerMap.get(sessionId)); - player.submitDeck(deck); + match.submitDeck(sessionPlayerMap.get(sessionId), deck); } else { TournamentManager.getInstance().submitDeck(tournament.getId(), sessionId, deck); @@ -262,7 +252,13 @@ public class TableController { } public synchronized void startMatch(UUID sessionId) { - if (sessionId.equals(this.sessionId) && table.getState() == TableState.STARTING) { + if (sessionId.equals(this.sessionId)) { + startMatch(); + } + } + + public synchronized void startMatch() { + if (table.getState() == TableState.STARTING) { try { match.startMatch(); startGame(null); @@ -284,7 +280,6 @@ public class TableController { public synchronized void startTournament(UUID sessionId) { if (sessionId.equals(this.sessionId) && table.getState() == TableState.STARTING) { - table.initTournament(); TournamentManager.getInstance().createTournamentSession(tournament, sessionPlayerMap, table.getId()); SessionManager sessionManager = SessionManager.getInstance(); for (Entry entry: sessionPlayerMap.entrySet()) { @@ -302,42 +297,19 @@ public class TableController { } } - private void sideboard() { - table.sideboard(); - for (MatchPlayer player: match.getPlayers()) { - player.setSideboarding(); - player.getPlayer().sideboard(table, player.getDeck()); - } - while (!match.isDoneSideboarding()){} - } - - private void sideboard(UUID playerId, Deck deck) { + private void sideboard(UUID playerId, Deck deck, int timeout) { SessionManager sessionManager = SessionManager.getInstance(); for (Entry entry: sessionPlayerMap.entrySet()) { if (entry.getValue().equals(playerId)) { - sessionManager.getSession(entry.getKey()).sideboard(deck, table.getId(), SIDEBOARD_TIME); + sessionManager.getSession(entry.getKey()).sideboard(deck, table.getId(), timeout); break; } } } -// public void construct() { -// table.construct(); -// for (TournamentPlayer player: tournament.getPlayers()) { -// player.setConstructing(); -// player.getPlayer().construct(table, player.getDeck()); -// } -// } - -// private void construct(UUID playerId, Deck deck) { -// SessionManager sessionManager = SessionManager.getInstance(); -// for (Entry entry: sessionPlayerMap.entrySet()) { -// if (entry.getValue().equals(playerId)) { -// sessionManager.getSession(entry.getKey()).construct(deck, table.getId(), CONSTRUCT_TIME); -// break; -// } -// } -// } + public void construct() { + table.construct(); + } public void endGame() { UUID choosingPlayerId = match.getChooser(); @@ -347,7 +319,8 @@ public class TableController { GameManager.getInstance().removeGame(match.getGame().getId()); try { if (!match.isMatchOver()) { - sideboard(); + table.sideboard(); + match.sideboard(); startGame(choosingPlayerId); } } catch (GameException ex) { @@ -433,4 +406,5 @@ public class TableController { public Match getMatch() { return match; } + } diff --git a/Mage.Server/src/main/java/mage/server/TableManager.java b/Mage.Server/src/main/java/mage/server/TableManager.java index 2a120a9a9e..914c77039b 100644 --- a/Mage.Server/src/main/java/mage/server/TableManager.java +++ b/Mage.Server/src/main/java/mage/server/TableManager.java @@ -67,6 +67,13 @@ public class TableManager { return tableController.getTable(); } + public Table createTable(MatchOptions options) { + TableController tableController = new TableController(UUID.randomUUID(), options); + controllers.put(tableController.getTable().getId(), tableController); + tables.put(tableController.getTable().getId(), tableController.getTable()); + return tableController.getTable(); + } + public Table createTournamentTable(UUID sessionId, TournamentOptions options) { TableController tableController = new TableController(sessionId, options); controllers.put(tableController.getTable().getId(), tableController); @@ -127,6 +134,10 @@ public class TableManager { controllers.get(tableId).startMatch(sessionId); } + public void startMatch(UUID roomId, UUID tableId) { + controllers.get(tableId).startMatch(); + } + public void startTournament(UUID sessionId, UUID roomId, UUID tableId) { controllers.get(tableId).startTournament(sessionId); } @@ -161,11 +172,12 @@ public class TableManager { } } -// public void construct(UUID tableId) { -// controllers.get(tableId).construct(); -// } + public void construct(UUID tableId) { + controllers.get(tableId).construct(); + } public void addPlayer(UUID sessionId, UUID tableId, Player player, String playerType, Deck deck) throws GameException { controllers.get(tableId).addPlayer(sessionId, player, playerType, deck); } + } diff --git a/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java b/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java index 36ce1e3230..9c18fefe56 100644 --- a/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java +++ b/Mage.Server/src/main/java/mage/server/tournament/TournamentController.java @@ -66,8 +66,6 @@ public class TournamentController { private ConcurrentHashMap sessionPlayerMap = new ConcurrentHashMap(); private ConcurrentHashMap tournamentSessions = new ConcurrentHashMap(); - private static final int CONSTRUCT_TIME = 600; - public TournamentController(Tournament tournament, ConcurrentHashMap sessionPlayerMap, UUID tableId) { sessionId = UUID.randomUUID(); this.sessionPlayerMap = sessionPlayerMap; @@ -96,6 +94,9 @@ public class TournamentController { case SUBMIT_DECK: submitDeck(event.getPlayerId(), event.getDeck()); break; + case CONSTRUCT: + construct(); + break; } } } @@ -170,12 +171,12 @@ public class TournamentController { private void startMatch(TournamentPairing pair, MatchOptions matchOptions) { try { TableManager tableManager = TableManager.getInstance(); - Table table = tableManager.createTable(sessionId, matchOptions); + Table table = tableManager.createTable(matchOptions); TournamentPlayer player1 = pair.getPlayer1(); TournamentPlayer player2 = pair.getPlayer2(); tableManager.addPlayer(getPlayerSessionId(player1.getPlayer().getId()), table.getId(), player1.getPlayer(), player1.getPlayerType(), player1.getDeck()); tableManager.addPlayer(getPlayerSessionId(player2.getPlayer().getId()), table.getId(), player2.getPlayer(), player2.getPlayerType(), player2.getDeck()); - tableManager.startMatch(sessionId, null, table.getId()); + tableManager.startMatch(null, table.getId()); pair.setMatch(tableManager.getMatch(table.getId())); } catch (GameException ex) { Logger.getLogger(TournamentController.class.getName()).log(Level.SEVERE, null, ex); @@ -186,12 +187,15 @@ public class TournamentController { TableManager.getInstance().startDraft(tableId, draft); } + private void construct() { + TableManager.getInstance().construct(tableId); + } + private synchronized void construct(UUID sessionId, Deck deck, int timeout) { if (tournamentSessions.containsKey(sessionId)) tournamentSessions.get(sessionId).construct(deck, timeout); } - public void submitDeck(UUID sessionId, Deck deck) { tournamentSessions.get(sessionPlayerMap.get(sessionId)).submitDeck(deck); } diff --git a/Mage/src/mage/game/Table.java b/Mage/src/mage/game/Table.java index 93bf40f2a4..8a244c67d6 100644 --- a/Mage/src/mage/game/Table.java +++ b/Mage/src/mage/game/Table.java @@ -84,10 +84,18 @@ public class Table implements Serializable { state = TableState.DUELING; } + public void initTournament() { + state = TableState.DUELING; + } + public void initDraft() { state = TableState.DRAFTING; } + public void construct() { + state = TableState.CONSTRUCTING; + } + public void endGame() { state = TableState.FINISHED; } @@ -157,24 +165,8 @@ public class Table implements Serializable { return this.name; } - public void fireSideboardEvent(UUID playerId, Deck deck) { - tableEventSource.fireTableEvent(EventType.SIDEBOARD, playerId, deck); - } - - public void fireConstructEvent(UUID playerId, Deck deck) { - tableEventSource.fireTableEvent(EventType.CONSTRUCT, playerId, deck); - } - - public void fireSubmitDeckEvent(UUID playerId, Deck deck) { - tableEventSource.fireTableEvent(EventType.SUBMIT_DECK, playerId, deck); - } - public void addTableEventListener(Listener listener) { tableEventSource.addListener(listener); } - public void initTournament() { - state = TableState.CONSTRUCTING; - } - } diff --git a/Mage/src/mage/game/events/TableEvent.java b/Mage/src/mage/game/events/TableEvent.java index 4d17710e19..aea35cadeb 100644 --- a/Mage/src/mage/game/events/TableEvent.java +++ b/Mage/src/mage/game/events/TableEvent.java @@ -56,6 +56,7 @@ public class TableEvent extends EventObject implements ExternalEvent, Serializab private Deck deck; private TournamentPairing pair; private MatchOptions options; + private int timeout; public TableEvent(EventType eventType) { super(eventType); @@ -70,11 +71,12 @@ public class TableEvent extends EventObject implements ExternalEvent, Serializab this.eventType = eventType; } - public TableEvent(EventType eventType, UUID playerId, Deck deck) { + public TableEvent(EventType eventType, UUID playerId, Deck deck, int timeout) { super(playerId); this.playerId = playerId; this.deck = deck; this.eventType = eventType; + this.timeout = timeout; } public TableEvent(EventType eventType, String message, Draft draft) { @@ -126,4 +128,8 @@ public class TableEvent extends EventObject implements ExternalEvent, Serializab public MatchOptions getMatchOptions() { return options; } + + public int getTimeout() { + return timeout; + } } diff --git a/Mage/src/mage/game/events/TableEventSource.java b/Mage/src/mage/game/events/TableEventSource.java index acd66a3184..bfb1bf0001 100644 --- a/Mage/src/mage/game/events/TableEventSource.java +++ b/Mage/src/mage/game/events/TableEventSource.java @@ -67,8 +67,8 @@ public class TableEventSource implements EventSource, Serializable { dispatcher.fireEvent(new TableEvent(eventType, message, cards, game)); } - public void fireTableEvent(EventType eventType, UUID playerId, Deck deck) { - dispatcher.fireEvent(new TableEvent(eventType, playerId, deck)); + public void fireTableEvent(EventType eventType, UUID playerId, Deck deck, int timeout) { + dispatcher.fireEvent(new TableEvent(eventType, playerId, deck, timeout)); } public void fireTableEvent(EventType eventType, TournamentPairing pair, MatchOptions options) { diff --git a/Mage/src/mage/game/match/Match.java b/Mage/src/mage/game/match/Match.java index 032edac9ea..64ae80b343 100644 --- a/Mage/src/mage/game/match/Match.java +++ b/Mage/src/mage/game/match/Match.java @@ -33,6 +33,8 @@ import java.util.UUID; import mage.cards.decks.Deck; import mage.game.Game; import mage.game.GameException; +import mage.game.events.Listener; +import mage.game.events.TableEvent; import mage.players.Player; /** @@ -46,8 +48,10 @@ public interface Match { public List getPlayers(); public MatchPlayer getPlayer(UUID playerId); public void addPlayer(Player player, Deck deck); + public void submitDeck(UUID playerId, Deck deck); public void startMatch() throws GameException; public void startGame() throws GameException; + public void sideboard(); public void endGame(); public Game getGame(); public List getGames(); @@ -56,4 +60,7 @@ public interface Match { public boolean isDoneSideboarding(); public UUID getChooser(); + public void addTableEventListener(Listener listener); + public void fireSideboardEvent(UUID playerId, Deck deck); + } diff --git a/Mage/src/mage/game/match/MatchImpl.java b/Mage/src/mage/game/match/MatchImpl.java index 01c3988e48..c6b5370a78 100644 --- a/Mage/src/mage/game/match/MatchImpl.java +++ b/Mage/src/mage/game/match/MatchImpl.java @@ -35,6 +35,10 @@ import java.util.logging.Logger; import mage.cards.decks.Deck; import mage.game.Game; import mage.game.GameException; +import mage.game.events.Listener; +import mage.game.events.TableEvent; +import mage.game.events.TableEvent.EventType; +import mage.game.events.TableEventSource; import mage.players.Player; import mage.util.Logging; @@ -45,11 +49,14 @@ import mage.util.Logging; public abstract class MatchImpl implements Match { private final static Logger logger = Logging.getLogger(MatchImpl.class.getName()); + private static final int SIDEBOARD_TIME = 180; protected UUID id = UUID.randomUUID(); protected List players = new ArrayList(); protected List games = new ArrayList(); protected MatchOptions options; + + protected TableEventSource tableEventSource = new TableEventSource(); public MatchImpl(MatchOptions options) { this.options = options; @@ -151,6 +158,26 @@ public abstract class MatchImpl implements Match { return loserId; } + @Override + public void addTableEventListener(Listener listener) { + tableEventSource.addListener(listener); + } + + @Override + public void sideboard() { + for (MatchPlayer player: this.players) { + player.setSideboarding(); + player.getPlayer().sideboard(this, player.getDeck()); + } + synchronized(this) { + while (!isDoneSideboarding()) { + try { + this.wait(); + } catch (InterruptedException ex) { } + } + } + } + @Override public boolean isDoneSideboarding() { for (MatchPlayer player: this.players) { @@ -160,4 +187,23 @@ public abstract class MatchImpl implements Match { return true; } + @Override + public void fireSideboardEvent(UUID playerId, Deck deck) { + MatchPlayer player = getPlayer(playerId); + if (player != null) { + tableEventSource.fireTableEvent(EventType.SIDEBOARD, playerId, deck, SIDEBOARD_TIME); + } + } + + @Override + public void submitDeck(UUID playerId, Deck deck) { + MatchPlayer player = getPlayer(playerId); + if (player != null) { + player.submitDeck(deck); + } + synchronized (this) { + this.notifyAll(); + } + } + } diff --git a/Mage/src/mage/game/tournament/TournamentImpl.java b/Mage/src/mage/game/tournament/TournamentImpl.java index 979d247627..fd75633b11 100644 --- a/Mage/src/mage/game/tournament/TournamentImpl.java +++ b/Mage/src/mage/game/tournament/TournamentImpl.java @@ -41,6 +41,7 @@ import java.util.logging.Logger; import mage.cards.Card; import mage.cards.ExpansionSet; import mage.cards.decks.Deck; +import mage.game.Table; import mage.game.events.Listener; import mage.game.events.PlayerQueryEvent; import mage.game.events.PlayerQueryEventSource; @@ -63,8 +64,10 @@ public abstract class TournamentImpl implements Tournament { protected String matchName; protected TournamentOptions options; - protected transient TableEventSource tableEventSource = new TableEventSource(); - protected transient PlayerQueryEventSource playerQueryEventSource = new PlayerQueryEventSource(); + protected TableEventSource tableEventSource = new TableEventSource(); + protected PlayerQueryEventSource playerQueryEventSource = new PlayerQueryEventSource(); + + private static final int CONSTRUCT_TIME = 600; public TournamentImpl(TournamentOptions options) { this.options = options; @@ -209,7 +212,7 @@ public abstract class TournamentImpl implements Tournament { @Override public void fireSubmitDeckEvent(UUID playerId, Deck deck) { - tableEventSource.fireTableEvent(EventType.SUBMIT_DECK, playerId, deck); + tableEventSource.fireTableEvent(EventType.SUBMIT_DECK, playerId, deck, 0); } @Override @@ -220,10 +223,11 @@ public abstract class TournamentImpl implements Tournament { @Override public void fireConstructEvent(UUID playerId, Deck deck) { TournamentPlayer player = players.get(playerId); - playerQueryEventSource.construct(playerId, "Construct", deck, 600); + playerQueryEventSource.construct(playerId, "Construct", deck, CONSTRUCT_TIME); } public void construct() { + tableEventSource.fireTableEvent(EventType.CONSTRUCT); for (TournamentPlayer player: players.values()) { player.setConstructing(); player.getPlayer().construct(this, player.getDeck()); diff --git a/Mage/src/mage/players/Player.java b/Mage/src/mage/players/Player.java index 850752feac..9749716a47 100644 --- a/Mage/src/mage/players/Player.java +++ b/Mage/src/mage/players/Player.java @@ -56,6 +56,7 @@ import mage.game.events.GameEvent; import mage.game.Game; import mage.game.Table; import mage.game.draft.Draft; +import mage.game.match.Match; import mage.game.permanent.Permanent; import mage.game.tournament.Tournament; import mage.target.Target; @@ -154,7 +155,7 @@ public interface Player extends MageItem, Copyable { public abstract void selectBlockers(Game game); public abstract void assignDamage(int damage, List targets, UUID sourceId, Game game); public abstract int getAmount(int min, int max, String message, Game game); - public abstract void sideboard(Table table, Deck deck); + public abstract void sideboard(Match match, Deck deck); public abstract void construct(Tournament tournament, Deck deck); public abstract void pickCard(List cards, Deck deck, Draft draft);