mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- CheckStyle.
This commit is contained in:
@@ -46,7 +46,7 @@ import forge.game.zone.ZoneType;
|
||||
*/
|
||||
public class ComputerAIGeneral implements Computer {
|
||||
|
||||
final private Player player;
|
||||
private final Player player;
|
||||
private final GameState game;
|
||||
/**
|
||||
* <p>
|
||||
@@ -306,9 +306,10 @@ public class ComputerAIGeneral implements Computer {
|
||||
game.getPhaseHandler().setPlayerMayHavePriority(false);
|
||||
|
||||
// ai is about to attack, cancel all phase skipping
|
||||
for (Player p : game.getPlayers())
|
||||
for (Player p : game.getPlayers()) {
|
||||
p.getController().autoPassCancel();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
||||
@@ -64,8 +64,9 @@ public class ComputerAIInput extends Input {
|
||||
@Override
|
||||
public final void showMessage() {
|
||||
// should not think when the game is over
|
||||
if( Singletons.getModel().getGame().isGameOver() )
|
||||
if (Singletons.getModel().getGame().isGameOver()) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* //put this back in ButtonUtil.disableAll();
|
||||
@@ -124,5 +125,5 @@ public class ComputerAIInput extends Input {
|
||||
/* (non-Javadoc)
|
||||
* @see forge.control.input.Input#isClassUpdated()
|
||||
*/
|
||||
@Override public void isClassUpdated() {}
|
||||
@Override public void isClassUpdated() { }
|
||||
}
|
||||
|
||||
@@ -1539,8 +1539,8 @@ public class ComputerUtil {
|
||||
Card prefCard = null;
|
||||
if (sa != null && sa.getActivatingPlayer() != null && sa.getActivatingPlayer().isHuman()) {
|
||||
for (Card c : hand) {
|
||||
if (c.hasKeyword("If a spell or ability an opponent controls causes you to discard CARDNAME," +
|
||||
" put it onto the battlefield instead of putting it into your graveyard.")) {
|
||||
if (c.hasKeyword("If a spell or ability an opponent controls causes you to discard CARDNAME,"
|
||||
+ " put it onto the battlefield instead of putting it into your graveyard.")) {
|
||||
prefCard = c;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -78,10 +78,11 @@ public class ComputerUtilAttack {
|
||||
this.computerList = ai.getCreaturesInPlay();
|
||||
|
||||
this.attackers = new ArrayList<Card>();
|
||||
for(Card c : computerList)
|
||||
if (CombatUtil.canAttack(c, human))
|
||||
for (Card c : computerList) {
|
||||
if (CombatUtil.canAttack(c, human)) {
|
||||
attackers.add(c);
|
||||
|
||||
}
|
||||
}
|
||||
this.blockers = this.getPossibleBlockers(humanList, this.attackers);
|
||||
} // constructor
|
||||
|
||||
@@ -875,7 +876,7 @@ public class ComputerUtilAttack {
|
||||
boolean hasCombatEffect = attacker.getSVar("HasCombatEffect").equals("TRUE");
|
||||
if (!hasCombatEffect) {
|
||||
for (String keyword : attacker.getKeyword()) {
|
||||
if (keyword.equals("Wither") || keyword.equals("Infect") || keyword.equals("Lifelink") ) {
|
||||
if (keyword.equals("Wither") || keyword.equals("Infect") || keyword.equals("Lifelink")) {
|
||||
hasCombatEffect = true;
|
||||
break;
|
||||
}
|
||||
@@ -914,7 +915,7 @@ public class ComputerUtilAttack {
|
||||
canKillAllDangerous = false;
|
||||
} else {
|
||||
for (String keyword : defender.getKeyword()) {
|
||||
if (keyword.equals("Wither") || keyword.equals("Infect") || keyword.equals("Lifelink") ) {
|
||||
if (keyword.equals("Wither") || keyword.equals("Infect") || keyword.equals("Lifelink")) {
|
||||
canKillAllDangerous = false;
|
||||
break;
|
||||
// there is a creature that can survive an attack from this creature
|
||||
|
||||
@@ -404,7 +404,7 @@ public class ComputerUtilBlock {
|
||||
* a {@link forge.game.phase.Combat} object.
|
||||
* @return a {@link forge.game.phase.Combat} object.
|
||||
*/
|
||||
final static Predicate<Card> rampagesOrNeedsManyToBlock = Predicates.or( CardPredicates.containsKeyword("Rampage"), CardPredicates.containsKeyword("CARDNAME can't be blocked by more than one creature."));
|
||||
static final Predicate<Card> rampagesOrNeedsManyToBlock = Predicates.or(CardPredicates.containsKeyword("Rampage"), CardPredicates.containsKeyword("CARDNAME can't be blocked by more than one creature."));
|
||||
|
||||
private static Combat makeGangBlocks(final Player ai, final Combat combat) {
|
||||
List<Card> currentAttackers = CardLists.filter(ComputerUtilBlock.getAttackersLeft(), Predicates.not(rampagesOrNeedsManyToBlock));
|
||||
|
||||
@@ -8,20 +8,20 @@ package forge.game.player;
|
||||
*/
|
||||
public class LobbyPlayer {
|
||||
|
||||
final protected PlayerType type;
|
||||
protected final PlayerType type;
|
||||
public final PlayerType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
|
||||
final protected String name;
|
||||
protected final String name;
|
||||
// string with picture is more important than avatar index
|
||||
protected String picture;
|
||||
private int avatarIndex = -1;
|
||||
|
||||
public LobbyPlayer(PlayerType type, String name)
|
||||
{
|
||||
public LobbyPlayer(PlayerType type, String name) {
|
||||
|
||||
this.type = type;
|
||||
this.name = name;
|
||||
}
|
||||
@@ -53,20 +53,26 @@ public class LobbyPlayer {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
if (this == obj) {
|
||||
return true;
|
||||
if (obj == null)
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
LobbyPlayer other = (LobbyPlayer) obj;
|
||||
if (name == null) {
|
||||
if (other.name != null)
|
||||
if (other.name != null) {
|
||||
return false;
|
||||
} else if (!name.equals(other.name))
|
||||
}
|
||||
} else if (!name.equals(other.name)) {
|
||||
return false;
|
||||
if (type != other.type)
|
||||
}
|
||||
if (type != other.type) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user