mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
- CheckStyle.
This commit is contained in:
@@ -321,8 +321,8 @@ public class Deck extends DeckBase {
|
||||
int deckDistinct = main.countDistinct();
|
||||
Integer max = type.getDeckMaximum();
|
||||
|
||||
if (deckSize < type.getDeckMinimum() || (max != null && deckSize > max) ||
|
||||
(type.isSingleton() && deckDistinct != deckSize)) {
|
||||
if (deckSize < type.getDeckMinimum() || (max != null && deckSize > max)
|
||||
|| (type.isSingleton() && deckDistinct != deckSize)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ public class DeckSection extends ItemPool<CardPrinted> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add all from a List of CardPrinted
|
||||
* Add all from a List of CardPrinted.
|
||||
*
|
||||
* @param list
|
||||
* CardPrinteds to add
|
||||
|
||||
@@ -33,6 +33,6 @@ public enum GameEndReason {
|
||||
WinsGameSpellEffect, // ones that could be both hardcoded (felidar) and
|
||||
// scripted ( such as Mayael's Aria )
|
||||
|
||||
/** Used to end multiplayer games where the all humans have lost or conceded while AIs cannot end match by themselves*/
|
||||
/** Used to end multiplayer games where the all humans have lost or conceded while AIs cannot end match by themselves.*/
|
||||
AllHumansLost,
|
||||
}
|
||||
|
||||
@@ -71,15 +71,17 @@ public class GameFormat {
|
||||
|
||||
private Predicate<CardPrinted> buildFilterPritned() {
|
||||
final Predicate<CardPrinted> banNames = CardPrinted.Predicates.namesExcept(this.bannedCardNames);
|
||||
if (this.allowedSetCodes == null || this.allowedSetCodes.isEmpty() )
|
||||
if (this.allowedSetCodes == null || this.allowedSetCodes.isEmpty()) {
|
||||
return banNames;
|
||||
}
|
||||
return Predicates.and(banNames, CardPrinted.Predicates.printedInSets(this.allowedSetCodes, true));
|
||||
}
|
||||
|
||||
private Predicate<CardPrinted> buildFilterRules() {
|
||||
final Predicate<CardPrinted> banNames = CardPrinted.Predicates.namesExcept(this.bannedCardNames);
|
||||
if ( this.allowedSetCodes == null || this.allowedSetCodes.isEmpty() )
|
||||
if (this.allowedSetCodes == null || this.allowedSetCodes.isEmpty()) {
|
||||
return banNames;
|
||||
}
|
||||
return Predicates.and(banNames, Predicates.compose(CardRulesPredicates.wasPrintedInSets(this.allowedSetCodes), CardPrinted.FN_GET_RULES));
|
||||
}
|
||||
|
||||
|
||||
@@ -70,8 +70,9 @@ public class GameNew {
|
||||
}
|
||||
|
||||
if (!useAnte && card.hasKeyword("Remove CARDNAME from your deck before playing if you're not playing for ante.")) {
|
||||
if(!removedAnteCards.containsKey(player))
|
||||
if (!removedAnteCards.containsKey(player)) {
|
||||
removedAnteCards.put(player, new ArrayList<String>());
|
||||
}
|
||||
removedAnteCards.get(player).add(card.getName());
|
||||
} else {
|
||||
library.add(card);
|
||||
@@ -92,9 +93,10 @@ public class GameNew {
|
||||
// do this instead of shuffling Computer's deck
|
||||
final Iterable<Card> c1 = GameNew.smoothComputerManaCurve(player.getCardsIn(ZoneType.Library));
|
||||
player.getZone(ZoneType.Library).setCards(c1);
|
||||
} else
|
||||
} else {
|
||||
player.shuffle();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -142,7 +144,6 @@ public class GameNew {
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (rAICards.size() > 0) {
|
||||
String message = buildFourColumnList("AI deck contains the following cards that it can't play or may be buggy:", rAICards);
|
||||
JOptionPane.showMessageDialog(null, message, "", JOptionPane.INFORMATION_MESSAGE);
|
||||
@@ -374,8 +375,9 @@ public class GameNew {
|
||||
sb.append(" lost the last game.");
|
||||
}
|
||||
if (goesFirst.isHuman()) {
|
||||
if( !humanPlayOrDraw(sb.toString()) )
|
||||
if (!humanPlayOrDraw(sb.toString())) {
|
||||
goesFirst = goesFirst.getOpponent();
|
||||
}
|
||||
} else {
|
||||
sb.append("\nComputer Going First");
|
||||
JOptionPane.showMessageDialog(null, sb.toString(),
|
||||
|
||||
@@ -77,11 +77,12 @@ public final class GameOutcome implements Iterable<Entry<LobbyPlayer, PlayerStat
|
||||
* @return true, if is draw
|
||||
*/
|
||||
public boolean isDraw() {
|
||||
for( PlayerStatistics pv : playerRating.values())
|
||||
{
|
||||
if ( pv.getOutcome().hasWon() )
|
||||
for (PlayerStatistics pv : playerRating.values()) {
|
||||
|
||||
if (pv.getOutcome().hasWon()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -103,11 +104,12 @@ public final class GameOutcome implements Iterable<Entry<LobbyPlayer, PlayerStat
|
||||
* @return the winner
|
||||
*/
|
||||
public LobbyPlayer getWinner() {
|
||||
for( Entry<LobbyPlayer, PlayerStatistics> ps : playerRating.entrySet())
|
||||
{
|
||||
if ( ps.getValue().getOutcome().hasWon() )
|
||||
for (Entry<LobbyPlayer, PlayerStatistics> ps : playerRating.entrySet()) {
|
||||
|
||||
if (ps.getValue().getOutcome().hasWon()) {
|
||||
return ps.getKey();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -155,11 +157,12 @@ public final class GameOutcome implements Iterable<Entry<LobbyPlayer, PlayerStat
|
||||
* @return the win spell effect
|
||||
*/
|
||||
public String getWinSpellEffect() {
|
||||
for( PlayerStatistics pv : playerRating.values())
|
||||
{
|
||||
if ( pv.getOutcome().hasWon() )
|
||||
for (PlayerStatistics pv : playerRating.values()) {
|
||||
|
||||
if (pv.getOutcome().hasWon()) {
|
||||
return pv.getOutcome().altWinSourceName;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user