Add Rich Man Swiss Draft

This commit is contained in:
gleeb 2021-05-06 00:03:29 -07:00
parent 3d015a50a0
commit 6d11b7f3e8
7 changed files with 136 additions and 2 deletions

View file

@ -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);
}
}

View file

@ -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;
}
}

View file

@ -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;
}
}
}

View file

@ -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;
}
}

View file

@ -95,13 +95,13 @@
<tournamentType name="Booster Draft Elimination" jar="mage-tournament-booster-draft.jar" className="mage.tournament.BoosterDraftEliminationTournament" typeName="mage.tournament.BoosterDraftEliminationTournamentType"/>
<tournamentType name="Booster Draft Elimination (Cube)" jar="mage-tournament-booster-draft.jar" className="mage.tournament.BoosterDraftEliminationTournament" typeName="mage.tournament.BoosterDraftEliminationCubeTournamentType"/>
<tournamentType name="Booster Draft Elimination (Random)" jar="mage-tournament-booster-draft.jar" className="mage.tournament.RandomBoosterDraftEliminationTournament" typeName="mage.tournament.RandomBoosterDraftEliminationTournamentType"/>
<tournamentType name="Booster Draft Elimination (Rich Man)" jar="mage-tournament-booster-draft.jar" className="mage.tournament.RichManDraftEliminationTournament" typeName="mage.tournament.RichManDraftEliminationTournamentType"/>
<tournamentType name="Booster Draft Elimination (Rich Man Cube)" jar="mage-tournament-booster-draft.jar" className="mage.tournament.RichManCubeDraftEliminationTournament" typeName="mage.tournament.RichManCubeDraftEliminationTournamentType"/>
<tournamentType name="Booster Draft Swiss" jar="mage-tournament-booster-draft.jar" className="mage.tournament.BoosterDraftSwissTournament" typeName="mage.tournament.BoosterDraftSwissTournamentType"/>
<tournamentType name="Booster Draft Swiss (Cube)" jar="mage-tournament-booster-draft.jar" className="mage.tournament.BoosterDraftSwissTournament" typeName="mage.tournament.BoosterDraftSwissCubeTournamentType"/>
<tournamentType name="Booster Draft Swiss (Random)" jar="mage-tournament-booster-draft.jar" className="mage.tournament.RandomBoosterDraftSwissTournament" typeName="mage.tournament.RandomBoosterDraftSwissTournamentType"/>
<tournamentType name="Booster Draft Swiss (Rich Man)" jar="mage-tournament-booster-draft.jar" className="mage.tournament.RichManDraftSwissTournament" typeName="mage.tournament.RichManDraftSwissTournamentType"/>
<tournamentType name="Booster Draft Swiss (Rich Man Cube)" jar="mage-tournament-booster-draft.jar" className="mage.tournament.RichManCubeDraftSwissTournament" typeName="mage.tournament.RichManCubeDraftSwissTournamentType"/>
<tournamentType name="Sealed Elimination" jar="mage-tournament-sealed.jar" className="mage.tournament.SealedEliminationTournament" typeName="mage.tournament.SealedEliminationTournamentType"/>
<tournamentType name="Sealed Elimination (Cube)" jar="mage-tournament-sealed.jar" className="mage.tournament.SealedEliminationTournament" typeName="mage.tournament.SealedEliminationCubeTournamentType"/>
<tournamentType name="Sealed Swiss" jar="mage-tournament-sealed.jar" className="mage.tournament.SealedSwissTournament" typeName="mage.tournament.SealedSwissTournamentType"/>

View file

@ -94,6 +94,8 @@
<tournamentType name="Booster Draft Swiss" jar="mage-tournament-boosterdraft-${project.version}.jar" className="mage.tournament.BoosterDraftSwissTournament" typeName="mage.tournament.BoosterDraftSwissTournamentType"/>
<tournamentType name="Booster Draft Swiss (Cube)" jar="mage-tournament-boosterdraft-${project.version}.jar" className="mage.tournament.BoosterDraftSwissTournament" typeName="mage.tournament.BoosterDraftSwissCubeTournamentType"/>
<tournamentType name="Booster Draft Swiss (Random)" jar="mage-tournament-boosterdraft-${project.version}.jar" className="mage.tournament.RandomBoosterDraftSwissTournament" typeName="mage.tournament.RandomBoosterDraftSwissTournamentType"/>
<tournamentType name="Booster Draft Swiss (Rich Man)" jar="mage-tournament-booster-draft.jar" className="mage.tournament.RichManDraftSwissTournament" typeName="mage.tournament.RichManDraftSwissTournamentType"/>
<tournamentType name="Booster Draft Swiss (Rich Man Cube)" jar="mage-tournament-booster-draft.jar" className="mage.tournament.RichManCubeDraftSwissTournament" typeName="mage.tournament.RichManCubeDraftSwissTournamentType"/>
<tournamentType name="Sealed Elimination" jar="mage-tournament-sealed-${project.version}.jar" className="mage.tournament.SealedEliminationTournament" typeName="mage.tournament.SealedEliminationTournamentType"/>
<tournamentType name="Sealed Elimination (Cube)" jar="mage-tournament-sealed-${project.version}.jar" className="mage.tournament.SealedEliminationTournament" typeName="mage.tournament.SealedEliminationCubeTournamentType"/>
<tournamentType name="Sealed Swiss" jar="mage-tournament-sealed-${project.version}.jar" className="mage.tournament.SealedSwissTournament" typeName="mage.tournament.SealedSwissTournamentType"/>

View file

@ -66,6 +66,8 @@
<tournamentType name="Booster Draft Swiss" jar="mage-tournament-booster-draft.jar" className="mage.tournament.BoosterDraftSwissTournament" typeName="mage.tournament.BoosterDraftSwissTournamentType"/>
<tournamentType name="Booster Draft Swiss (Cube)" jar="mage-tournament-booster-draft.jar" className="mage.tournament.BoosterDraftSwissTournament" typeName="mage.tournament.BoosterDraftSwissCubeTournamentType"/>
<tournamentType name="Booster Draft Swiss (Random)" jar="mage-tournament-booster-draft.jar" className="mage.tournament.RandomBoosterDraftSwissTournament" typeName="mage.tournament.RandomBoosterDraftSwissTournamentType"/>
<tournamentType name="Booster Draft Swiss (Rich Man)" jar="mage-tournament-booster-draft.jar" className="mage.tournament.RichManDraftSwissTournament" typeName="mage.tournament.RichManDraftSwissTournamentType"/>
<tournamentType name="Booster Draft Swiss (Rich Man Cube)" jar="mage-tournament-booster-draft.jar" className="mage.tournament.RichManCubeDraftSwissTournament" typeName="mage.tournament.RichManCubeDraftSwissTournamentType"/>
<tournamentType name="Sealed Elimination" jar="mage-tournament-sealed.jar" className="mage.tournament.SealedEliminationTournament" typeName="mage.tournament.SealedEliminationTournamentType"/>
<tournamentType name="Sealed Elimination (Cube)" jar="mage-tournament-sealed.jar" className="mage.tournament.SealedEliminationTournament" typeName="mage.tournament.SealedEliminationCubeTournamentType"/>
<tournamentType name="Sealed Swiss" jar="mage-tournament-sealed.jar" className="mage.tournament.SealedSwissTournament" typeName="mage.tournament.SealedSwissTournamentType"/>