diff --git a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/RichManCubeDraftSwissTournament.java b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/RichManCubeDraftSwissTournament.java new file mode 100644 index 0000000000..45c4e72bce --- /dev/null +++ b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/RichManCubeDraftSwissTournament.java @@ -0,0 +1,30 @@ +package mage.tournament; + +import mage.constants.TournamentPlayerState; +import mage.game.draft.DraftOptions; +import mage.game.draft.RichManCubeBoosterDraft; +import mage.game.events.TableEvent; +import mage.game.tournament.TournamentOptions; +import mage.game.tournament.TournamentPlayer; + +/** + * + * @author glee- + */ +public class RichManCubeDraftSwissTournament extends BoosterDraftSwissTournament { + + public RichManCubeDraftSwissTournament(TournamentOptions options) { + super(options); + } + + @Override + protected void draft() { + draft = new RichManCubeBoosterDraft((DraftOptions) options.getLimitedOptions(), getSets()); + for (TournamentPlayer player : players.values()) { + draft.addPlayer(player.getPlayer()); + player.setState(TournamentPlayerState.DRAFTING); + } + tableEventSource.fireTableEvent(TableEvent.EventType.START_DRAFT, null, draft); + } + +} diff --git a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/RichManCubeDraftSwissTournamentType.java b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/RichManCubeDraftSwissTournamentType.java new file mode 100644 index 0000000000..d167a56e8f --- /dev/null +++ b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/RichManCubeDraftSwissTournamentType.java @@ -0,0 +1,22 @@ +package mage.tournament; + +import mage.game.tournament.TournamentType; + +/** + * + * @author glee- + */ +public class RichManCubeDraftSwissTournamentType extends TournamentType { + + public RichManCubeDraftSwissTournamentType() { + this.name = "Booster Draft Swiss (Rich Man Cube)"; + this.maxPlayers = 16; + this.minPlayers = 2; + this.numBoosters = 1; + this.draft = true; + this.limited = true; + this.cubeBooster = true; + this.elimination = false; + } + +} diff --git a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/RichManDraftSwissTournament.java b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/RichManDraftSwissTournament.java new file mode 100644 index 0000000000..8c84e89905 --- /dev/null +++ b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/RichManDraftSwissTournament.java @@ -0,0 +1,54 @@ +package mage.tournament; + +import mage.constants.TournamentPlayerState; +import mage.game.draft.DraftOptions; +import mage.game.draft.RichManBoosterDraft; +import mage.game.events.TableEvent; +import mage.game.tournament.TournamentOptions; +import mage.game.tournament.TournamentPlayer; + +/** + * + * @author glee- + */ +public class RichManDraftSwissTournament extends BoosterDraftSwissTournament { + public RichManDraftSwissTournament(TournamentOptions options) { + super(options); + } + + @Override + protected void draft() { + draft = new RichManBoosterDraft((DraftOptions) options.getLimitedOptions(), getSets()); + for (TournamentPlayer player : players.values()) { + draft.addPlayer(player.getPlayer()); + player.setState(TournamentPlayerState.DRAFTING); + } + tableEventSource.fireTableEvent(TableEvent.EventType.START_DRAFT, null, draft); + } + + @Override + public void nextStep() { + if (isAbort()) { + currentStep = TournamentStep.COMPETE; + } + switch (currentStep) { + case START: + currentStep = TournamentStep.DRAFT; + draft(); + break; + case DRAFT: + currentStep = TournamentStep.CONSTRUCT; + construct(); + break; + case CONSTRUCT: + currentStep = TournamentStep.COMPETE; + runTournament(); + break; + case COMPETE: + currentStep = TournamentStep.WINNERS; + winners(); + end(); + break; + } + } +} diff --git a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/RichManDraftSwissTournamentType.java b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/RichManDraftSwissTournamentType.java new file mode 100644 index 0000000000..fee3a3d434 --- /dev/null +++ b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/src/mage/tournament/RichManDraftSwissTournamentType.java @@ -0,0 +1,24 @@ +package mage.tournament; + +import mage.game.tournament.TournamentType; + +/** + * + * @author glee- + */ +public class RichManDraftSwissTournamentType extends TournamentType { + + public RichManDraftSwissTournamentType() { + this.name = "Booster Draft Swiss (Rich Man)"; + this.maxPlayers = 16; + this.minPlayers = 2; + this.numBoosters = 1; + this.draft = true; + this.limited = true; + this.cubeBooster = false; + this.elimination = false; + this.isRandom = false; + this.isRichMan = true; + } + +} diff --git a/Mage.Server/config/config.xml b/Mage.Server/config/config.xml index 0f329b9f2c..c338da393d 100644 --- a/Mage.Server/config/config.xml +++ b/Mage.Server/config/config.xml @@ -95,13 +95,13 @@ - - + + diff --git a/Mage.Server/release/config/config.xml b/Mage.Server/release/config/config.xml index c21407073c..6154429ea5 100644 --- a/Mage.Server/release/config/config.xml +++ b/Mage.Server/release/config/config.xml @@ -94,6 +94,8 @@ + + diff --git a/Mage.Server/src/test/resources/config_error.xml b/Mage.Server/src/test/resources/config_error.xml index 046070b441..a516c14c48 100644 --- a/Mage.Server/src/test/resources/config_error.xml +++ b/Mage.Server/src/test/resources/config_error.xml @@ -66,6 +66,8 @@ + +