change enum equals to ==

This commit is contained in:
ingmargoudt 2017-03-01 15:05:44 +01:00
parent 82841c16c6
commit d01aed42ed
40 changed files with 57 additions and 57 deletions

View file

@ -1465,12 +1465,12 @@ public abstract class GameImpl implements Game, Serializable {
newEffect.init(newAbility, this);
// If there are already copy effects with dration = Custom to the same object, remove the existing effects because they no longer have any effect
if (Duration.Custom.equals(duration)) {
if (duration == Duration.Custom) {
for (Effect effect : getState().getContinuousEffects().getLayeredEffects(this)) {
if (effect instanceof CopyEffect) {
CopyEffect copyEffect = (CopyEffect) effect;
// there is another copy effect that copies to the same permanent
if (copyEffect.getSourceId().equals(copyToPermanentId) && copyEffect.getDuration().equals(Duration.Custom)) {
if (copyEffect.getSourceId().equals(copyToPermanentId) && copyEffect.getDuration() == Duration.Custom) {
copyEffect.discard();
}
}
@ -1750,7 +1750,7 @@ public abstract class GameImpl implements Game, Serializable {
if (spellAbility.getTargets().isEmpty()) {
for (Ability ability : perm.getAbilities(this)) {
if ((ability instanceof SpellAbility)
&& SpellAbilityType.BASE_ALTERNATE.equals(((SpellAbility) ability).getSpellAbilityType())
&& SpellAbilityType.BASE_ALTERNATE == ((SpellAbility) ability).getSpellAbilityType()
&& !ability.getTargets().isEmpty()) {
spellAbility = (SpellAbility) ability;
break;
@ -2337,6 +2337,7 @@ public abstract class GameImpl implements Game, Serializable {
}
Iterator it = gameCards.entrySet().iterator();
while (it.hasNext()) {
Entry<UUID, Card> entry = (Entry<UUID, Card>) it.next();
Card card = entry.getValue();
@ -2507,7 +2508,7 @@ public abstract class GameImpl implements Game, Serializable {
@Override
public MageObject getLastKnownInformation(UUID objectId, Zone zone, int zoneChangeCounter) {
if (zone.equals(Zone.BATTLEFIELD)) {
if (zone == Zone.BATTLEFIELD) {
Map<Integer, MageObject> lkiMapExtended = lkiExtended.get(objectId);
if (lkiMapExtended != null) {

View file

@ -218,7 +218,7 @@ public class Spell extends StackObjImpl implements Card {
for (UUID modeId : spellAbility.getModes().getSelectedModes()) {
spellAbility.getModes().setActiveMode(modeId);
if (spellAbility.getTargets().stillLegal(spellAbility, game)) {
if (!spellAbility.getSpellAbilityType().equals(SpellAbilityType.SPLICE)) {
if (spellAbility.getSpellAbilityType() != SpellAbilityType.SPLICE) {
updateOptionalCosts(index);
}
result |= spellAbility.resolve(game);

View file

@ -283,14 +283,14 @@ public abstract class TournamentImpl implements Tournament {
// set player state if he finished the round
if (round.getRoundNumber() == rounds.size()) { // for elimination getRoundNumber = 0 so never true here
match.setTournamentRound(round.getRoundNumber());
if (tp1.getState().equals(TournamentPlayerState.DUELING)) {
if (tp1.getState() == TournamentPlayerState.DUELING) {
if (round.getRoundNumber() == getNumberRounds()) {
tp1.setState(TournamentPlayerState.FINISHED);
} else {
tp1.setState(TournamentPlayerState.WAITING);
}
}
if (tp2.getState().equals(TournamentPlayerState.DUELING)) {
if (tp2.getState() == TournamentPlayerState.DUELING) {
if (round.getRoundNumber() == getNumberRounds()) {
tp2.setState(TournamentPlayerState.FINISHED);
} else {

View file

@ -145,7 +145,7 @@ public class Turn implements Serializable {
if (game.isPaused() || game.gameOver(null)) {
return false;
}
if (!isEndTurnRequested() || phase.getType().equals(TurnPhase.END)) {
if (!isEndTurnRequested() || phase.getType() == TurnPhase.END) {
currentPhase = phase;
game.fireEvent(new GameEvent(GameEvent.EventType.PHASE_CHANGED, activePlayer.getId(), null, activePlayer.getId()));
if (!game.getState().getTurnMods().skipPhase(activePlayer.getId(), currentPhase.getType())) {