Merge branch 'glee--feature/addRichManSwiss'

This commit is contained in:
xenohedron 2023-06-07 19:45:34 -04:00
commit 44f3ef444e
7 changed files with 136 additions and 0 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

@ -102,6 +102,8 @@
<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 (Remixed)" jar="mage-tournament-booster-draft.jar" className="mage.tournament.RemixedBoosterDraftSwissTournament" typeName="mage.tournament.RemixedBoosterDraftSwissTournamentType"/>
<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

@ -96,6 +96,8 @@
<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 (Remixed)" jar="mage-tournament-boosterdraft-${project.version}.jar" className="mage.tournament.RemixedBoosterDraftSwissTournament" typeName="mage.tournament.RemixedBoosterDraftSwissTournamentType"/>
<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

@ -67,6 +67,8 @@
<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 (Remixed)" jar="mage-tournament-booster-draft.jar" className="mage.tournament.RemixedBoosterDraftSwissTournament" typeName="mage.tournament.RemixedBoosterDraftSwissTournamentType"/>
<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"/>