mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- CheckStyle.
This commit is contained in:
@@ -71,7 +71,9 @@ public final class CardUtil {
|
|||||||
* @return a {@link forge.Card} object.
|
* @return a {@link forge.Card} object.
|
||||||
*/
|
*/
|
||||||
public static <T> T getRandom(final T[] o) {
|
public static <T> T getRandom(final T[] o) {
|
||||||
if ( o == null ) throw new IllegalArgumentException("CardUtil : getRandom(T) recieved null instead of array.");
|
if (o == null) {
|
||||||
|
throw new IllegalArgumentException("CardUtil : getRandom(T) recieved null instead of array.");
|
||||||
|
}
|
||||||
int len = o.length;
|
int len = o.length;
|
||||||
switch(len) {
|
switch(len) {
|
||||||
case 0: throw new IllegalArgumentException("CardUtil : getRandom(T) recieved an empty array.");
|
case 0: throw new IllegalArgumentException("CardUtil : getRandom(T) recieved an empty array.");
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ public class ComputerAIGeneral implements Computer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the spellAbilities from the card list
|
* Returns the spellAbilities from the card list.
|
||||||
*
|
*
|
||||||
* @param l
|
* @param l
|
||||||
* a {@link forge.CardList} object.
|
* a {@link forge.CardList} object.
|
||||||
|
|||||||
@@ -199,8 +199,9 @@ public class DefaultPlayerZone extends PlayerZone implements java.io.Serializabl
|
|||||||
@Override
|
@Override
|
||||||
public final void setCards(final Iterable<Card> cards) {
|
public final void setCards(final Iterable<Card> cards) {
|
||||||
List<Card> toSet = new ArrayList<Card>();
|
List<Card> toSet = new ArrayList<Card>();
|
||||||
for(Card c : cards)
|
for (Card c : cards) {
|
||||||
toSet.add(c);
|
toSet.add(c);
|
||||||
|
}
|
||||||
this.setCardList(toSet);
|
this.setCardList(toSet);
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -353,12 +353,13 @@ public class PlayerZoneComesIntoPlay extends DefaultPlayerZone {
|
|||||||
// Battlefield filters out Phased Out cards by default. Needs to call
|
// Battlefield filters out Phased Out cards by default. Needs to call
|
||||||
// getCards(false) to get Phased Out cards
|
// getCards(false) to get Phased Out cards
|
||||||
|
|
||||||
if (!filter)
|
if (!filter) {
|
||||||
return new ArrayList<Card>(this.getCardList());
|
return new ArrayList<Card>(this.getCardList());
|
||||||
|
}
|
||||||
|
|
||||||
final ArrayList<Card> list = new ArrayList<Card>();
|
final ArrayList<Card> list = new ArrayList<Card>();
|
||||||
for(Card crd : this.getCardList())
|
for (Card crd : this.getCardList()) {
|
||||||
{
|
|
||||||
if (!crd.isPhasedOut()) {
|
if (!crd.isPhasedOut()) {
|
||||||
list.add(crd);
|
list.add(crd);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user