mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 05:22:02 -08: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
|
|
@ -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…
Add table
Add a link
Reference in a new issue