mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
cleanup in constants, removing unused ones,
replacing maps with list/arrays traversal by indexes remove imports
This commit is contained in:
@@ -20,10 +20,7 @@ package forge;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,8 +79,6 @@ public final class Constant {
|
|||||||
/** The Colorless. */
|
/** The Colorless. */
|
||||||
public static final String COLORLESS = "colorless";
|
public static final String COLORLESS = "colorless";
|
||||||
// color order "wubrg"
|
// color order "wubrg"
|
||||||
/** The Colors. */
|
|
||||||
public static final ImmutableList<String> COLORS = ImmutableList.of(Color.WHITE, Color.BLUE, Color.BLACK, Color.RED, Color.GREEN, Color.COLORLESS);
|
|
||||||
|
|
||||||
/** The only colors. */
|
/** The only colors. */
|
||||||
public static final ImmutableList<String> ONLY_COLORS = ImmutableList.of(Color.WHITE, Color.BLUE, Color.BLACK, Color.RED, Color.GREEN);
|
public static final ImmutableList<String> ONLY_COLORS = ImmutableList.of(Color.WHITE, Color.BLUE, Color.BLACK, Color.RED, Color.GREEN);
|
||||||
@@ -91,26 +86,8 @@ public final class Constant {
|
|||||||
/** The Snow. */
|
/** The Snow. */
|
||||||
public static final String SNOW = "snow";
|
public static final String SNOW = "snow";
|
||||||
|
|
||||||
/** The Mana colors. */
|
|
||||||
public static final String[] MANA_COLORS = { Color.WHITE, Color.BLUE, Color.BLACK, Color.RED, Color.GREEN,
|
|
||||||
Color.COLORLESS, Color.SNOW };
|
|
||||||
|
|
||||||
/** The Basic lands. */
|
/** The Basic lands. */
|
||||||
public static final List<String> BASIC_LANDS = Collections.unmodifiableList(Arrays.asList("Plains", "Island", "Swamp", "Mountain", "Forest"));
|
public static final List<String> BASIC_LANDS = Collections.unmodifiableList(Arrays.asList("Plains", "Island", "Swamp", "Mountain", "Forest"));
|
||||||
|
|
||||||
public static final Map<String, String> BASIC_LAND_TYPE_TO_COLOR_MAP;
|
|
||||||
|
|
||||||
static
|
|
||||||
{
|
|
||||||
Map<String, String> TypeTocol = new HashMap<String, String>();
|
|
||||||
TypeTocol.put("Plains", Color.WHITE);
|
|
||||||
TypeTocol.put("Island", Color.BLUE);
|
|
||||||
TypeTocol.put("Swamp", Color.BLACK);
|
|
||||||
TypeTocol.put("Mountain", Color.RED);
|
|
||||||
TypeTocol.put("Forest", Color.GREEN);
|
|
||||||
|
|
||||||
BASIC_LAND_TYPE_TO_COLOR_MAP = Collections.unmodifiableMap(TypeTocol);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -24,11 +24,9 @@ import java.util.Map.Entry;
|
|||||||
|
|
||||||
import org.apache.commons.lang.math.IntRange;
|
import org.apache.commons.lang.math.IntRange;
|
||||||
|
|
||||||
import forge.Constant;
|
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.card.CardCoreType;
|
import forge.card.CardCoreType;
|
||||||
import forge.card.ColorSet;
|
import forge.card.ColorSet;
|
||||||
import forge.card.MagicColor;
|
|
||||||
import forge.item.CardDb;
|
import forge.item.CardDb;
|
||||||
import forge.item.CardPrinted;
|
import forge.item.CardPrinted;
|
||||||
import forge.item.IPaperCard;
|
import forge.item.IPaperCard;
|
||||||
|
|||||||
@@ -683,8 +683,9 @@ public final class GameActionUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// add all appropriate mana abilities based on current types
|
// add all appropriate mana abilities based on current types
|
||||||
for (String landType : Constant.Color.BASIC_LANDS) {
|
for(int i = 0; i < MagicColor.WUBRG.length; i++ ) {
|
||||||
String color = MagicColor.toShortString(Constant.Color.BASIC_LAND_TYPE_TO_COLOR_MAP.get(landType));
|
String landType = Constant.Color.BASIC_LANDS.get(i);
|
||||||
|
String color = MagicColor.toShortString(MagicColor.WUBRG[i]);
|
||||||
String abString = "AB$ Mana | Cost$ T | Produced$ " + color + " | SpellDescription$ Add " + color + " to your mana pool.";
|
String abString = "AB$ Mana | Cost$ T | Produced$ " + color + " | SpellDescription$ Add " + color + " to your mana pool.";
|
||||||
for (final Card land : lands) {
|
for (final Card land : lands) {
|
||||||
if (land.isType(landType)) {
|
if (land.isType(landType)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user