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 df767ece5a..199ee37e10 100644 --- a/Mage.Server/config/config.xml +++ b/Mage.Server/config/config.xml @@ -102,6 +102,8 @@ + + diff --git a/Mage.Server/release/config/config.xml b/Mage.Server/release/config/config.xml index 4915604a76..6a4b76a8a3 100644 --- a/Mage.Server/release/config/config.xml +++ b/Mage.Server/release/config/config.xml @@ -96,6 +96,8 @@ + + diff --git a/Mage.Server/src/test/data/config_error.xml b/Mage.Server/src/test/data/config_error.xml index 134de3a1fe..757bcb5f78 100644 --- a/Mage.Server/src/test/data/config_error.xml +++ b/Mage.Server/src/test/data/config_error.xml @@ -67,6 +67,8 @@ + +