mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
[refactor] removed generic parameter from Game classes
This commit is contained in:
parent
4fd248c4f8
commit
9324e93868
27 changed files with 32 additions and 37 deletions
|
@ -34,7 +34,7 @@ import mage.game.match.MatchType;
|
|||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class CommanderDuelType extends MatchType<CommanderDuelType> {
|
||||
public class CommanderDuelType extends MatchType {
|
||||
|
||||
public CommanderDuelType() {
|
||||
this.name = "Commander Two Player Duel";
|
||||
|
|
|
@ -35,7 +35,7 @@ import mage.game.match.MatchType;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class CommanderFreeForAllType extends MatchType<CommanderFreeForAllType> {
|
||||
public class CommanderFreeForAllType extends MatchType {
|
||||
|
||||
public CommanderFreeForAllType() {
|
||||
this.name = "Commander Free For All";
|
||||
|
|
|
@ -40,7 +40,7 @@ import mage.players.Player;
|
|||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class FreeForAll extends GameImpl<FreeForAll> {
|
||||
public class FreeForAll extends GameImpl {
|
||||
|
||||
private int numPlayers;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.game.match.MatchType;
|
|||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class FreeForAllType extends MatchType<FreeForAllType> {
|
||||
public class FreeForAllType extends MatchType {
|
||||
|
||||
public FreeForAllType() {
|
||||
this.name = "Free For All";
|
||||
|
|
|
@ -38,7 +38,7 @@ import mage.game.match.MatchType;
|
|||
import mage.game.turn.TurnMod;
|
||||
import mage.players.Player;
|
||||
|
||||
public class TwoPlayerDuel extends GameImpl<TwoPlayerDuel> {
|
||||
public class TwoPlayerDuel extends GameImpl {
|
||||
|
||||
public TwoPlayerDuel(MultiplayerAttackOption attackOption, RangeOfInfluence range, int freeMulligans) {
|
||||
super(attackOption, range, freeMulligans);
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.game.match.MatchType;
|
|||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class TwoPlayerDuelType extends MatchType<TwoPlayerDuelType> {
|
||||
public class TwoPlayerDuelType extends MatchType {
|
||||
|
||||
public TwoPlayerDuelType() {
|
||||
this.name = "Two Player Duel";
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.game.tournament.TournamentType;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class BoosterDraftEliminationCubeTournamentType extends TournamentType<BoosterDraftEliminationCubeTournamentType> {
|
||||
public class BoosterDraftEliminationCubeTournamentType extends TournamentType {
|
||||
|
||||
public BoosterDraftEliminationCubeTournamentType() {
|
||||
this.name = "Booster Draft Elimination (Cube)";
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.game.tournament.TournamentType;
|
|||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class BoosterDraftEliminationTournamentType extends TournamentType<BoosterDraftEliminationTournamentType> {
|
||||
public class BoosterDraftEliminationTournamentType extends TournamentType {
|
||||
|
||||
public BoosterDraftEliminationTournamentType() {
|
||||
this.name = "Booster Draft Elimination";
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.game.tournament.TournamentType;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class BoosterDraftSwissCubeTournamentType extends TournamentType<BoosterDraftSwissCubeTournamentType> {
|
||||
public class BoosterDraftSwissCubeTournamentType extends TournamentType {
|
||||
|
||||
public BoosterDraftSwissCubeTournamentType() {
|
||||
this.name = "Booster Draft Swiss (Cube)";
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.game.tournament.TournamentType;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class BoosterDraftSwissTournamentType extends TournamentType<BoosterDraftSwissTournamentType> {
|
||||
public class BoosterDraftSwissTournamentType extends TournamentType {
|
||||
|
||||
public BoosterDraftSwissTournamentType() {
|
||||
this.name = "Booster Draft Swiss";
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.game.tournament.TournamentType;
|
|||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class ConstructedEliminationTournamentType extends TournamentType<ConstructedEliminationTournamentType> {
|
||||
public class ConstructedEliminationTournamentType extends TournamentType {
|
||||
|
||||
public ConstructedEliminationTournamentType() {
|
||||
this.name = "Elimination Constructed";
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.game.tournament.TournamentType;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class SealedEliminationCubeTournamentType extends TournamentType<SealedEliminationCubeTournamentType> {
|
||||
public class SealedEliminationCubeTournamentType extends TournamentType {
|
||||
|
||||
public SealedEliminationCubeTournamentType() {
|
||||
this.name = "Sealed Elimination (Cube)";
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.game.tournament.TournamentType;
|
|||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class SealedEliminationTournamentType extends TournamentType<SealedEliminationTournamentType> {
|
||||
public class SealedEliminationTournamentType extends TournamentType {
|
||||
|
||||
public SealedEliminationTournamentType() {
|
||||
this.name = "Sealed Elimination";
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.game.tournament.TournamentType;
|
|||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class SealedSwissCubeTournamentType extends TournamentType<SealedSwissCubeTournamentType> {
|
||||
public class SealedSwissCubeTournamentType extends TournamentType {
|
||||
|
||||
public SealedSwissCubeTournamentType() {
|
||||
this.name = "Sealed Swiss (Cube)";
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.game.tournament.TournamentType;
|
|||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class SealedSwissTournamentType extends TournamentType<SealedSwissTournamentType> {
|
||||
public class SealedSwissTournamentType extends TournamentType {
|
||||
|
||||
public SealedSwissTournamentType() {
|
||||
this.name = "Sealed Swiss";
|
||||
|
|
|
@ -138,7 +138,7 @@ class PrimalClayEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class PrimalClayChoice extends ChoiceImpl<PrimalClayChoice> {
|
||||
class PrimalClayChoice extends ChoiceImpl {
|
||||
PrimalClayChoice() {
|
||||
super(true);
|
||||
this.setMessage("Choose for Primal Clay to be");
|
||||
|
|
|
@ -132,7 +132,7 @@ class PrimalPlasmaEffect extends ContinuousEffectImpl {
|
|||
return new PrimalPlasmaEffect(this);
|
||||
}
|
||||
}
|
||||
class PrimalPlasmaChoice extends ChoiceImpl<PrimalPlasmaChoice> {
|
||||
class PrimalPlasmaChoice extends ChoiceImpl {
|
||||
PrimalPlasmaChoice() {
|
||||
super(true);
|
||||
this.choices.add("a 3/3 creature");
|
||||
|
|
|
@ -32,7 +32,7 @@ package mage.choices;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ChoiceBasicLandType extends ChoiceImpl<ChoiceBasicLandType> {
|
||||
public class ChoiceBasicLandType extends ChoiceImpl {
|
||||
|
||||
public ChoiceBasicLandType() {
|
||||
super(true);
|
||||
|
|
|
@ -34,7 +34,7 @@ import mage.ObjectColor;
|
|||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class ChoiceColor extends ChoiceImpl<ChoiceColor> {
|
||||
public class ChoiceColor extends ChoiceImpl {
|
||||
|
||||
public ChoiceColor() {
|
||||
super(true);
|
||||
|
|
|
@ -35,9 +35,8 @@ import java.util.Set;
|
|||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
* @param <T>
|
||||
*/
|
||||
public class ChoiceImpl<T extends ChoiceImpl<T>> implements Choice, Serializable {
|
||||
public class ChoiceImpl implements Choice, Serializable {
|
||||
|
||||
protected boolean chosen;
|
||||
protected boolean required;
|
||||
|
@ -53,7 +52,7 @@ public class ChoiceImpl<T extends ChoiceImpl<T>> implements Choice, Serializable
|
|||
this.required = required;
|
||||
}
|
||||
|
||||
public ChoiceImpl(ChoiceImpl<T> choice) {
|
||||
public ChoiceImpl(ChoiceImpl choice) {
|
||||
this.choice = choice.choice;
|
||||
this.chosen = choice.chosen;
|
||||
this.required = choice.required;
|
||||
|
@ -111,8 +110,8 @@ public class ChoiceImpl<T extends ChoiceImpl<T>> implements Choice, Serializable
|
|||
}
|
||||
|
||||
@Override
|
||||
public T copy() {
|
||||
return (T)new ChoiceImpl(this);
|
||||
public ChoiceImpl copy() {
|
||||
return new ChoiceImpl(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ package mage.choices;
|
|||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class ChoiceLeftOrRight extends ChoiceImpl<ChoiceLeftOrRight> {
|
||||
public class ChoiceLeftOrRight extends ChoiceImpl {
|
||||
|
||||
public ChoiceLeftOrRight() {
|
||||
super(true);
|
||||
|
|
|
@ -53,7 +53,7 @@ import mage.players.Player;
|
|||
import mage.target.common.TargetCardInHand;
|
||||
import mage.watchers.common.CommanderCombatDamageWatcher;
|
||||
|
||||
public abstract class GameCommanderImpl extends GameImpl<GameCommanderImpl> {
|
||||
public abstract class GameCommanderImpl extends GameImpl {
|
||||
|
||||
private final Map<UUID, Cards> mulliganedCards = new HashMap<UUID, Cards>();
|
||||
private final Set<CommanderCombatDamageWatcher> commanderCombatWatcher = new HashSet<CommanderCombatDamageWatcher>();
|
||||
|
|
|
@ -122,7 +122,7 @@ import mage.watchers.common.PlayerLostLifeWatcher;
|
|||
import mage.watchers.common.SoulbondWatcher;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializable {
|
||||
public abstract class GameImpl implements Game, Serializable {
|
||||
|
||||
private static final transient Logger logger = Logger.getLogger(GameImpl.class);
|
||||
|
||||
|
@ -189,9 +189,6 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
|
|||
private boolean saveGame = false;
|
||||
private int priorityTime;
|
||||
|
||||
@Override
|
||||
public abstract T copy();
|
||||
|
||||
public GameImpl(MultiplayerAttackOption attackOption, RangeOfInfluence range, int freeMulligans) {
|
||||
this.id = UUID.randomUUID();
|
||||
this.range = range;
|
||||
|
@ -201,7 +198,7 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
|
|||
// this.actions = new LinkedList<MageAction>();
|
||||
}
|
||||
|
||||
public GameImpl(final GameImpl<T> game) {
|
||||
public GameImpl(final GameImpl game) {
|
||||
long t1 = 0;
|
||||
if (logger.isDebugEnabled()) {
|
||||
t1 = System.currentTimeMillis();
|
||||
|
|
|
@ -35,7 +35,7 @@ import mage.cards.ExpansionSet;
|
|||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class BoosterDraft extends DraftImpl<BoosterDraft> {
|
||||
public class BoosterDraft extends DraftImpl {
|
||||
|
||||
public BoosterDraft(DraftOptions options, List<ExpansionSet> sets) {
|
||||
super(options, sets);
|
||||
|
|
|
@ -48,9 +48,8 @@ import mage.players.PlayerList;
|
|||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
* @param <T>
|
||||
*/
|
||||
public abstract class DraftImpl<T extends DraftImpl<T>> implements Draft {
|
||||
public abstract class DraftImpl implements Draft {
|
||||
|
||||
protected final UUID id;
|
||||
protected final Map<UUID, DraftPlayer> players = new HashMap<>();
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.io.Serializable;
|
|||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public abstract class MatchType<T extends MatchType<T>> implements Serializable {
|
||||
public abstract class MatchType implements Serializable {
|
||||
|
||||
protected String name;
|
||||
protected int minPlayers;
|
||||
|
@ -56,7 +56,7 @@ public abstract class MatchType<T extends MatchType<T>> implements Serializable
|
|||
this.useAttackOption = matchType.useAttackOption;
|
||||
}
|
||||
|
||||
public abstract T copy();
|
||||
public abstract MatchType copy();
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.io.Serializable;
|
|||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class TournamentType <T extends TournamentType<T>> implements Serializable {
|
||||
public class TournamentType implements Serializable {
|
||||
|
||||
protected String name;
|
||||
protected int minPlayers;
|
||||
|
|
Loading…
Reference in a new issue