- CheckStyle.

This commit is contained in:
Chris
2012-05-25 17:40:45 +00:00
parent 6281803987
commit d4bd459a76
3 changed files with 24 additions and 18 deletions

View File

@@ -257,19 +257,23 @@ public final class CardUtil {
public static ArrayList<String> getOnlyColors(final Card c) {
final CardManaCost m = c.getManaCost();
final byte color_profile = m.getColorProfile();
final Set<String> colors = new HashSet<String>();
if ((color_profile & forge.card.CardColor.WHITE) > 0 )
colors.add(Constant.Color.WHITE);
if ((color_profile & forge.card.CardColor.BLACK) > 0 )
colors.add(Constant.Color.BLACK);
if ((color_profile & forge.card.CardColor.BLUE) > 0 )
colors.add(Constant.Color.BLUE);
if ((color_profile & forge.card.CardColor.RED) > 0 )
colors.add(Constant.Color.RED);
if ((color_profile & forge.card.CardColor.GREEN) > 0 )
colors.add(Constant.Color.GREEN);
final Set<String> colors = new HashSet<String>();
if ((color_profile & forge.card.CardColor.WHITE) > 0) {
colors.add(Constant.Color.WHITE);
}
if ((color_profile & forge.card.CardColor.BLACK) > 0) {
colors.add(Constant.Color.BLACK);
}
if ((color_profile & forge.card.CardColor.BLUE) > 0) {
colors.add(Constant.Color.BLUE);
}
if ((color_profile & forge.card.CardColor.RED) > 0) {
colors.add(Constant.Color.RED);
}
if ((color_profile & forge.card.CardColor.GREEN) > 0) {
colors.add(Constant.Color.GREEN);
}
for (final String kw : c.getKeyword()) {
if (kw.startsWith(c.getName() + " is ") || kw.startsWith("CARDNAME is ")) {

View File

@@ -76,7 +76,7 @@ public enum Counters {
/** The DESPAIR. */
DESPAIR(),
/** The DEVOTION. */
DEVOTION(),

View File

@@ -137,15 +137,17 @@ public final class CardManaCost implements Comparable<CardManaCost> {
public List<ManaCostShard> getShards() {
return this.shards;
}
public int getShardCount(ManaCostShard which) {
if ( which == ManaCostShard.COLORLESS )
if (which == ManaCostShard.COLORLESS) {
return genericCost;
}
int res = 0;
for(ManaCostShard shard : shards)
{
if ( shard == which ) res++;
for (ManaCostShard shard : shards) {
if (shard == which) {
res++;
}
}
return res;
}