mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 19:11:59 -08:00
Refactoring
See github line by line comments in 'File changed'
This commit is contained in:
parent
01bb9572e9
commit
c0cf22bbf7
31 changed files with 51 additions and 53 deletions
|
|
@ -132,7 +132,7 @@ public interface Game extends MageItem, Serializable {
|
||||||
|
|
||||||
void setZone(UUID objectId, Zone zone);
|
void setZone(UUID objectId, Zone zone);
|
||||||
|
|
||||||
void addPlayer(Player player, Deck deck) throws GameException;
|
void addPlayer(Player player, Deck deck);
|
||||||
|
|
||||||
Player getPlayer(UUID playerId);
|
Player getPlayer(UUID playerId);
|
||||||
|
|
||||||
|
|
@ -437,7 +437,7 @@ public interface Game extends MageItem, Serializable {
|
||||||
// controlling the behaviour of replacement effects while permanents entering the battlefield
|
// controlling the behaviour of replacement effects while permanents entering the battlefield
|
||||||
void setScopeRelevant(boolean scopeRelevant);
|
void setScopeRelevant(boolean scopeRelevant);
|
||||||
|
|
||||||
public boolean getScopeRelevant();
|
boolean getScopeRelevant();
|
||||||
|
|
||||||
// players' timers
|
// players' timers
|
||||||
void initTimer(UUID playerId);
|
void initTimer(UUID playerId);
|
||||||
|
|
|
||||||
|
|
@ -335,7 +335,7 @@ public abstract class GameImpl implements Game, Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addPlayer(Player player, Deck deck) throws GameException {
|
public void addPlayer(Player player, Deck deck) {
|
||||||
player.useDeck(deck, this);
|
player.useDeck(deck, this);
|
||||||
state.addPlayer(player);
|
state.addPlayer(player);
|
||||||
}
|
}
|
||||||
|
|
@ -1937,7 +1937,7 @@ public abstract class GameImpl implements Game, Serializable {
|
||||||
Player controller = this.getPlayer(planeswalker.getControllerId());
|
Player controller = this.getPlayer(planeswalker.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
Target targetPlaneswalkerToKeep = new TargetPermanent(filterPlaneswalker);
|
Target targetPlaneswalkerToKeep = new TargetPermanent(filterPlaneswalker);
|
||||||
targetPlaneswalkerToKeep.setTargetName(new StringBuilder(planeswalker.getName()).append(" to keep?").toString());
|
targetPlaneswalkerToKeep.setTargetName(planeswalker.getName() + " to keep?");
|
||||||
controller.chooseTarget(Outcome.Benefit, targetPlaneswalkerToKeep, null, this);
|
controller.chooseTarget(Outcome.Benefit, targetPlaneswalkerToKeep, null, this);
|
||||||
for (Permanent dupPlaneswalker : this.getBattlefield().getActivePermanents(filterPlaneswalker, planeswalker.getControllerId(), this)) {
|
for (Permanent dupPlaneswalker : this.getBattlefield().getActivePermanents(filterPlaneswalker, planeswalker.getControllerId(), this)) {
|
||||||
if (!targetPlaneswalkerToKeep.getTargets().contains(dupPlaneswalker.getId())) {
|
if (!targetPlaneswalkerToKeep.getTargets().contains(dupPlaneswalker.getId())) {
|
||||||
|
|
@ -2345,12 +2345,7 @@ public abstract class GameImpl implements Game, Serializable {
|
||||||
}
|
}
|
||||||
// Then, if that player controlled any objects on the stack not represented by cards, those objects cease to exist.
|
// Then, if that player controlled any objects on the stack not represented by cards, those objects cease to exist.
|
||||||
this.getState().getContinuousEffects().removeInactiveEffects(this);
|
this.getState().getContinuousEffects().removeInactiveEffects(this);
|
||||||
for (Iterator<StackObject> it = getStack().iterator(); it.hasNext();) {
|
getStack().removeIf(object -> object.getControllerId().equals(playerId));
|
||||||
StackObject object = it.next();
|
|
||||||
if (object.getControllerId().equals(playerId)) {
|
|
||||||
it.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Then, if there are any objects still controlled by that player, those objects are exiled.
|
// Then, if there are any objects still controlled by that player, those objects are exiled.
|
||||||
applyEffects(); // to remove control from effects removed meanwhile
|
applyEffects(); // to remove control from effects removed meanwhile
|
||||||
List<Permanent> permanents = this.getBattlefield().getAllActivePermanents(playerId);
|
List<Permanent> permanents = this.getBattlefield().getAllActivePermanents(playerId);
|
||||||
|
|
@ -2594,10 +2589,10 @@ public abstract class GameImpl implements Game, Serializable {
|
||||||
if (object instanceof Permanent) {
|
if (object instanceof Permanent) {
|
||||||
Map<Integer, MageObject> lkiExtendedMap = lkiExtended.get(objectId);
|
Map<Integer, MageObject> lkiExtendedMap = lkiExtended.get(objectId);
|
||||||
if (lkiExtendedMap != null) {
|
if (lkiExtendedMap != null) {
|
||||||
lkiExtendedMap.put(((Permanent) object).getZoneChangeCounter(this), copy);
|
lkiExtendedMap.put(object.getZoneChangeCounter(this), copy);
|
||||||
} else {
|
} else {
|
||||||
lkiExtendedMap = new HashMap<>();
|
lkiExtendedMap = new HashMap<>();
|
||||||
lkiExtendedMap.put(((Permanent) object).getZoneChangeCounter(this), copy);
|
lkiExtendedMap.put(object.getZoneChangeCounter(this), copy);
|
||||||
lkiExtended.put(objectId, lkiExtendedMap);
|
lkiExtended.put(objectId, lkiExtendedMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2689,7 +2684,7 @@ public abstract class GameImpl implements Game, Serializable {
|
||||||
permanent.entersBattlefield(permanent.getId(), this, Zone.OUTSIDE, false);
|
permanent.entersBattlefield(permanent.getId(), this, Zone.OUTSIDE, false);
|
||||||
getBattlefield().addPermanent(permanent);
|
getBattlefield().addPermanent(permanent);
|
||||||
getPermanentsEntering().remove(permanent.getId());
|
getPermanentsEntering().remove(permanent.getId());
|
||||||
((PermanentImpl) permanent).removeSummoningSickness();
|
permanent.removeSummoningSickness();
|
||||||
if (card.isTapped()) {
|
if (card.isTapped()) {
|
||||||
permanent.setTapped(true);
|
permanent.setTapped(true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,9 +64,8 @@ public class Table implements Serializable {
|
||||||
private TableRecorder recorder;
|
private TableRecorder recorder;
|
||||||
|
|
||||||
public interface TableRecorder {
|
public interface TableRecorder {
|
||||||
|
|
||||||
void record(Table table);
|
void record(Table table);
|
||||||
};
|
}
|
||||||
|
|
||||||
protected TableEventSource tableEventSource = new TableEventSource();
|
protected TableEventSource tableEventSource = new TableEventSource();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package mage.game;
|
package mage.game;
|
||||||
|
|
||||||
import mage.cards.MeldCard;
|
import mage.cards.MeldCard;
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.game.events.ZoneChangeEvent;
|
import mage.game.events.ZoneChangeEvent;
|
||||||
import mage.game.stack.Spell;
|
import mage.game.stack.Spell;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,11 +52,7 @@ public class ZonesHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Iterator<ZoneChangeInfo> itr = zoneChangeInfos.iterator(); itr.hasNext();) {
|
zoneChangeInfos.removeIf(zoneChangeInfo -> !maybeRemoveFromSourceZone(zoneChangeInfo, game));
|
||||||
if (!maybeRemoveFromSourceZone(itr.next(), game)) {
|
|
||||||
itr.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (ZoneChangeInfo zoneChangeInfo : zoneChangeInfos) {
|
for (ZoneChangeInfo zoneChangeInfo : zoneChangeInfos) {
|
||||||
placeInDestinationZone(zoneChangeInfo, game);
|
placeInDestinationZone(zoneChangeInfo, game);
|
||||||
if (game.getPhase() != null) { // moving cards to zones before game started does not need events
|
if (game.getPhase() != null) { // moving cards to zones before game started does not need events
|
||||||
|
|
|
||||||
|
|
@ -983,7 +983,7 @@ public class Combat implements Serializable, Copyable<Combat> {
|
||||||
for (Ability ability : entry.getValue()) {
|
for (Ability ability : entry.getValue()) {
|
||||||
if (!effect.canBlockCheckAfter(ability, game)) {
|
if (!effect.canBlockCheckAfter(ability, game)) {
|
||||||
if (controller.isHuman()) {
|
if (controller.isHuman()) {
|
||||||
game.informPlayer(controller, new StringBuilder(blockingCreature.getLogName()).append(" can't block this way.").toString());
|
game.informPlayer(controller, blockingCreature.getLogName() + " can't block this way.");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
// remove blocking creatures for AI
|
// remove blocking creatures for AI
|
||||||
|
|
@ -1003,7 +1003,7 @@ public class Combat implements Serializable, Copyable<Combat> {
|
||||||
for (Ability ability : entry.getValue()) {
|
for (Ability ability : entry.getValue()) {
|
||||||
if (!effect.canBeBlockedCheckAfter(attackingCreature, ability, game)) {
|
if (!effect.canBeBlockedCheckAfter(attackingCreature, ability, game)) {
|
||||||
if (controller.isHuman()) {
|
if (controller.isHuman()) {
|
||||||
game.informPlayer(controller, new StringBuilder(attackingCreature.getLogName()).append(" can't be blocked this way.").toString());
|
game.informPlayer(controller, attackingCreature.getLogName() + " can't be blocked this way.");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
// remove blocking creatures for AI
|
// remove blocking creatures for AI
|
||||||
|
|
@ -1030,7 +1030,7 @@ public class Combat implements Serializable, Copyable<Combat> {
|
||||||
switch (game.getAttackOption()) {
|
switch (game.getAttackOption()) {
|
||||||
case LEFT:
|
case LEFT:
|
||||||
players = game.getState().getPlayerList(attackingPlayerId);
|
players = game.getState().getPlayerList(attackingPlayerId);
|
||||||
while (true && attackingPlayer.isInGame()) {
|
while (attackingPlayer.isInGame()) {
|
||||||
Player opponent = players.getNext(game);
|
Player opponent = players.getNext(game);
|
||||||
if (attackingPlayer.hasOpponent(opponent.getId(), game)) {
|
if (attackingPlayer.hasOpponent(opponent.getId(), game)) {
|
||||||
addDefender(opponent.getId(), game);
|
addDefender(opponent.getId(), game);
|
||||||
|
|
@ -1040,7 +1040,7 @@ public class Combat implements Serializable, Copyable<Combat> {
|
||||||
break;
|
break;
|
||||||
case RIGHT:
|
case RIGHT:
|
||||||
players = game.getState().getPlayerList(attackingPlayerId);
|
players = game.getState().getPlayerList(attackingPlayerId);
|
||||||
while (true && attackingPlayer.isInGame()) {
|
while (attackingPlayer.isInGame()) {
|
||||||
Player opponent = players.getPrevious(game);
|
Player opponent = players.getPrevious(game);
|
||||||
if (attackingPlayer.hasOpponent(opponent.getId(), game)) {
|
if (attackingPlayer.hasOpponent(opponent.getId(), game)) {
|
||||||
addDefender(opponent.getId(), game);
|
addDefender(opponent.getId(), game);
|
||||||
|
|
|
||||||
|
|
@ -457,7 +457,7 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
||||||
Player player = game.getPlayer(playerId);
|
Player player = game.getPlayer(playerId);
|
||||||
List<UUID> blockerList = new ArrayList<>(blockers);
|
List<UUID> blockerList = new ArrayList<>(blockers);
|
||||||
blockerOrder.clear();
|
blockerOrder.clear();
|
||||||
while (true && player.canRespond()) {
|
while (player.canRespond()) {
|
||||||
if (blockerList.size() == 1) {
|
if (blockerList.size() == 1) {
|
||||||
blockerOrder.add(blockerList.get(0));
|
blockerOrder.add(blockerList.get(0));
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ package mage.game.draft;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.repository.CardCriteria;
|
import mage.cards.repository.CardCriteria;
|
||||||
import mage.cards.repository.CardInfo;
|
import mage.cards.repository.CardInfo;
|
||||||
|
|
|
||||||
|
|
@ -302,7 +302,7 @@ public class GameEvent implements Serializable {
|
||||||
COMBAT_DAMAGE_APPLIED,
|
COMBAT_DAMAGE_APPLIED,
|
||||||
SELECTED_ATTACKER, SELECTED_BLOCKER,
|
SELECTED_ATTACKER, SELECTED_BLOCKER,
|
||||||
//custom events
|
//custom events
|
||||||
CUSTOM_EVENT;
|
CUSTOM_EVENT
|
||||||
}
|
}
|
||||||
|
|
||||||
private GameEvent(EventType type, UUID customEventType,
|
private GameEvent(EventType type, UUID customEventType,
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ public interface Match {
|
||||||
|
|
||||||
void submitDeck(UUID playerId, Deck deck);
|
void submitDeck(UUID playerId, Deck deck);
|
||||||
void updateDeck(UUID playerId, Deck deck);
|
void updateDeck(UUID playerId, Deck deck);
|
||||||
void startMatch() throws GameException;
|
void startMatch();
|
||||||
void startGame() throws GameException;
|
void startGame() throws GameException;
|
||||||
void sideboard();
|
void sideboard();
|
||||||
void endGame();
|
void endGame();
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@ import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.cards.decks.Deck;
|
import mage.cards.decks.Deck;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
@ -121,7 +120,7 @@ public abstract class MatchImpl implements Match {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startMatch() throws GameException {
|
public void startMatch() {
|
||||||
this.startTime = new Date();
|
this.startTime = new Date();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ public interface Permanent extends Card, Controllable {
|
||||||
|
|
||||||
boolean canLoyaltyBeUsed(Game game);
|
boolean canLoyaltyBeUsed(Game game);
|
||||||
|
|
||||||
public void resetControl();
|
void resetControl();
|
||||||
|
|
||||||
boolean changeControllerId(UUID controllerId, Game game);
|
boolean changeControllerId(UUID controllerId, Game game);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -981,7 +981,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
|
||||||
moveToZone(Zone.GRAVEYARD, sourceId, game, false);
|
moveToZone(Zone.GRAVEYARD, sourceId, game, false);
|
||||||
Player player = game.getPlayer(getControllerId());
|
Player player = game.getPlayer(getControllerId());
|
||||||
if (player != null && !game.isSimulation()) {
|
if (player != null && !game.isSimulation()) {
|
||||||
game.informPlayers(new StringBuilder(player.getLogName()).append(" sacrificed ").append(this.getLogName()).toString());
|
game.informPlayers(player.getLogName() + " sacrificed " + this.getLogName());
|
||||||
}
|
}
|
||||||
game.fireEvent(GameEvent.getEvent(EventType.SACRIFICED_PERMANENT, objectId, sourceId, controllerId));
|
game.fireEvent(GameEvent.getEvent(EventType.SACRIFICED_PERMANENT, objectId, sourceId, controllerId));
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
package mage.game.permanent.token;
|
package mage.game.permanent.token;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.util.RandomUtil;
|
import mage.util.RandomUtil;
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@
|
||||||
package mage.game.permanent.token;
|
package mage.game.permanent.token;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.DiesTriggeredAbility;
|
import mage.abilities.common.DiesTriggeredAbility;
|
||||||
|
|
@ -44,7 +46,7 @@ public class DevilToken extends Token {
|
||||||
|
|
||||||
public DevilToken() {
|
public DevilToken() {
|
||||||
super("Devil", "1/1 red Devil creature with \"When this creature dies, it deals 1 damage to target creature or player.\"");
|
super("Devil", "1/1 red Devil creature with \"When this creature dies, it deals 1 damage to target creature or player.\"");
|
||||||
availableImageSetCodes.addAll(Arrays.asList("SOI"));
|
availableImageSetCodes.addAll(Collections.singletonList("SOI"));
|
||||||
cardType.add(CardType.CREATURE);
|
cardType.add(CardType.CREATURE);
|
||||||
subtype.add("Devil");
|
subtype.add("Devil");
|
||||||
color.setRed(true);
|
color.setRed(true);
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@
|
||||||
package mage.game.permanent.token;
|
package mage.game.permanent.token;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
|
||||||
|
|
@ -39,7 +41,7 @@ public class DroidToken extends Token {
|
||||||
|
|
||||||
public DroidToken() {
|
public DroidToken() {
|
||||||
super("Droid", "1/1 colorless Droid creature token");
|
super("Droid", "1/1 colorless Droid creature token");
|
||||||
availableImageSetCodes.addAll(Arrays.asList("SWS"));
|
availableImageSetCodes.addAll(Collections.singletonList("SWS"));
|
||||||
|
|
||||||
cardType.add(CardType.CREATURE);
|
cardType.add(CardType.CREATURE);
|
||||||
cardType.add(CardType.ARTIFACT);
|
cardType.add(CardType.ARTIFACT);
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ package mage.game.permanent.token;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
|
@ -42,7 +43,7 @@ public class EldraziHorrorToken extends Token {
|
||||||
final static private List<String> tokenImageSets = new ArrayList<>();
|
final static private List<String> tokenImageSets = new ArrayList<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
tokenImageSets.addAll(Arrays.asList("EMN"));
|
tokenImageSets.addAll(Collections.singletonList("EMN"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public EldraziHorrorToken() {
|
public EldraziHorrorToken() {
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ package mage.game.permanent.token;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.Mana;
|
import mage.Mana;
|
||||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ package mage.game.permanent.token;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.Mana;
|
import mage.Mana;
|
||||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@
|
||||||
package mage.game.permanent.token;
|
package mage.game.permanent.token;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -38,7 +40,7 @@ public class EwokToken extends Token {
|
||||||
|
|
||||||
public EwokToken() {
|
public EwokToken() {
|
||||||
super("Ewok", "1/1 green Ewok creature tokens", 1, 1);
|
super("Ewok", "1/1 green Ewok creature tokens", 1, 1);
|
||||||
availableImageSetCodes.addAll(Arrays.asList("SWS"));
|
availableImageSetCodes.addAll(Collections.singletonList("SWS"));
|
||||||
|
|
||||||
cardType.add(CardType.CREATURE);
|
cardType.add(CardType.CREATURE);
|
||||||
subtype.add("Ewok");
|
subtype.add("Ewok");
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ package mage.game.permanent.token;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
|
@ -42,7 +43,7 @@ public class PrismToken extends Token {
|
||||||
final static private List<String> tokenImageSets = new ArrayList<>();
|
final static private List<String> tokenImageSets = new ArrayList<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
tokenImageSets.addAll(Arrays.asList("VIS"));
|
tokenImageSets.addAll(Collections.singletonList("VIS"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public PrismToken() {
|
public PrismToken() {
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ package mage.game.permanent.token;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
|
@ -43,7 +44,7 @@ public class ServoToken extends Token {
|
||||||
final static private List<String> tokenImageSets = new ArrayList<>();
|
final static private List<String> tokenImageSets = new ArrayList<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
tokenImageSets.addAll(Arrays.asList("KLD"));
|
tokenImageSets.addAll(Collections.singletonList("KLD"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServoToken() {
|
public ServoToken() {
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ package mage.game.permanent.token;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
|
@ -42,7 +43,7 @@ public class SquirrelToken extends Token {
|
||||||
final static private List<String> tokenImageSets = new ArrayList<>();
|
final static private List<String> tokenImageSets = new ArrayList<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
tokenImageSets.addAll(Arrays.asList("CNS"));
|
tokenImageSets.addAll(Collections.singletonList("CNS"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public SquirrelToken() {
|
public SquirrelToken() {
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ package mage.game.permanent.token;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
|
@ -43,7 +44,7 @@ public class ThrullToken extends Token {
|
||||||
final static private List<String> tokenImageSets = new ArrayList<>();
|
final static private List<String> tokenImageSets = new ArrayList<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
tokenImageSets.addAll(Arrays.asList("MM2"));
|
tokenImageSets.addAll(Collections.singletonList("MM2"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ThrullToken() {
|
public ThrullToken() {
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@
|
||||||
package mage.game.permanent.token;
|
package mage.game.permanent.token;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
|
||||||
|
|
@ -39,7 +41,7 @@ public class TrooperToken extends Token {
|
||||||
|
|
||||||
public TrooperToken() {
|
public TrooperToken() {
|
||||||
super("Trooper", "1/1 white Trooper creature token");
|
super("Trooper", "1/1 white Trooper creature token");
|
||||||
availableImageSetCodes.addAll(Arrays.asList("SWS"));
|
availableImageSetCodes.addAll(Collections.singletonList("SWS"));
|
||||||
|
|
||||||
cardType.add(CardType.CREATURE);
|
cardType.add(CardType.CREATURE);
|
||||||
subtype.add("Trooper");
|
subtype.add("Trooper");
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
package mage.game.permanent.token;
|
package mage.game.permanent.token;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Random;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.util.RandomUtil;
|
import mage.util.RandomUtil;
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ package mage.game.permanent.token;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.util.RandomUtil;
|
import mage.util.RandomUtil;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Random;
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
import mage.cards.ExpansionSet;
|
import mage.cards.ExpansionSet;
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
package mage.game.tournament;
|
package mage.game.tournament;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.constants.MultiplayerAttackOption;
|
import mage.constants.MultiplayerAttackOption;
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ public abstract class Step implements Serializable {
|
||||||
protected StepPart stepPart;
|
protected StepPart stepPart;
|
||||||
|
|
||||||
public enum StepPart {
|
public enum StepPart {
|
||||||
PRE, PRIORITY, POST;
|
PRE, PRIORITY, POST
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract Step copy();
|
public abstract Step copy();
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ public class TurnMods extends ArrayList<TurnMod> {
|
||||||
ListIterator<TurnMod> it = this.listIterator(this.size());
|
ListIterator<TurnMod> it = this.listIterator(this.size());
|
||||||
while (it.hasPrevious()) {
|
while (it.hasPrevious()) {
|
||||||
TurnMod turnMod = it.previous();
|
TurnMod turnMod = it.previous();
|
||||||
if (turnMod.isExtraTurn() == true && turnMod.getPlayerId().equals(playerId)) {
|
if (turnMod.isExtraTurn() && turnMod.getPlayerId().equals(playerId)) {
|
||||||
it.remove();
|
it.remove();
|
||||||
return turnMod.getId();
|
return turnMod.getId();
|
||||||
}
|
}
|
||||||
|
|
@ -64,7 +64,7 @@ public class TurnMods extends ArrayList<TurnMod> {
|
||||||
ListIterator<TurnMod> it = this.listIterator(this.size());
|
ListIterator<TurnMod> it = this.listIterator(this.size());
|
||||||
while (it.hasPrevious()) {
|
while (it.hasPrevious()) {
|
||||||
TurnMod turnMod = it.previous();
|
TurnMod turnMod = it.previous();
|
||||||
if (turnMod.isExtraTurn() == true) {
|
if (turnMod.isExtraTurn()) {
|
||||||
it.remove();
|
it.remove();
|
||||||
return turnMod;
|
return turnMod;
|
||||||
}
|
}
|
||||||
|
|
@ -76,7 +76,7 @@ public class TurnMods extends ArrayList<TurnMod> {
|
||||||
ListIterator<TurnMod> it = this.listIterator(this.size());
|
ListIterator<TurnMod> it = this.listIterator(this.size());
|
||||||
while (it.hasPrevious()) {
|
while (it.hasPrevious()) {
|
||||||
TurnMod turnMod = it.previous();
|
TurnMod turnMod = it.previous();
|
||||||
if (turnMod.isSkipTurn() == true && turnMod.getPlayerId().equals(playerId)) {
|
if (turnMod.isSkipTurn() && turnMod.getPlayerId().equals(playerId)) {
|
||||||
it.remove();
|
it.remove();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue