mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
* Bloodlord of Vaasgoth - Fixed that Vampires entering the battlefield did never bloodthirst from the Bloodlord.
This commit is contained in:
parent
e2873be2f8
commit
d9b20298b7
4 changed files with 80 additions and 69 deletions
|
|
@ -1,12 +1,10 @@
|
|||
/**
|
||||
* GathererSymbols.java
|
||||
*
|
||||
*
|
||||
* Created on 25.08.2010
|
||||
*/
|
||||
|
||||
package org.mage.plugins.card.dl.sources;
|
||||
|
||||
|
||||
import com.google.common.collect.AbstractIterator;
|
||||
import java.io.File;
|
||||
import static java.lang.String.format;
|
||||
|
|
@ -15,10 +13,9 @@ import org.mage.plugins.card.dl.DownloadJob;
|
|||
import static org.mage.plugins.card.dl.DownloadJob.fromURL;
|
||||
import static org.mage.plugins.card.dl.DownloadJob.toFile;
|
||||
|
||||
|
||||
/**
|
||||
* The class GathererSymbols.
|
||||
*
|
||||
*
|
||||
* @version V0.0 25.08.2010
|
||||
* @author Clemens Koza
|
||||
*/
|
||||
|
|
@ -26,24 +23,20 @@ public class GathererSymbols implements Iterable<DownloadJob> {
|
|||
//TODO chaos and planeswalker symbol
|
||||
//chaos: http://gatherer.wizards.com/Images/Symbols/chaos.gif
|
||||
|
||||
private static final String SYMBOLS_PATH = File.separator + "symbols";
|
||||
private static final String SYMBOLS_PATH = File.separator + "symbols";
|
||||
private static final File DEFAULT_OUT_DIR = new File("plugins" + File.separator + "images" + SYMBOLS_PATH);
|
||||
private static File outDir = DEFAULT_OUT_DIR;
|
||||
private static File outDir = DEFAULT_OUT_DIR;
|
||||
|
||||
private static final String urlFmt = "http://gatherer.wizards.com/handlers/image.ashx?size=%1$s&name=%2$s&type=symbol";
|
||||
private static final String urlFmt = "http://gatherer.wizards.com/handlers/image.ashx?size=%1$s&name=%2$s&type=symbol";
|
||||
|
||||
private static final String[] sizes = {"small", "medium", "large"};
|
||||
private static final String[] sizes = {"small", "medium", "large"};
|
||||
|
||||
private static final String[] symbols = {"W", "U", "B", "R", "G",
|
||||
|
||||
"W/U", "U/B", "B/R", "R/G", "G/W", "W/B", "U/R", "B/G", "R/W", "G/U",
|
||||
|
||||
"2/W", "2/U", "2/B", "2/R", "2/G",
|
||||
|
||||
"WP", "UP", "BP", "RP", "GP",
|
||||
|
||||
"X", "S", "T", "Q"};
|
||||
private static final int minNumeric = 0, maxNumeric = 16;
|
||||
"W/U", "U/B", "B/R", "R/G", "G/W", "W/B", "U/R", "B/G", "R/W", "G/U",
|
||||
"2/W", "2/U", "2/B", "2/R", "2/G",
|
||||
"WP", "UP", "BP", "RP", "GP",
|
||||
"X", "S", "T", "Q", "C"};
|
||||
private static final int minNumeric = 0, maxNumeric = 16;
|
||||
|
||||
public GathererSymbols(String path) {
|
||||
if (path == null) {
|
||||
|
|
@ -56,19 +49,19 @@ public class GathererSymbols implements Iterable<DownloadJob> {
|
|||
@Override
|
||||
public Iterator<DownloadJob> iterator() {
|
||||
return new AbstractIterator<DownloadJob>() {
|
||||
private int sizeIndex, symIndex, numeric = minNumeric;
|
||||
private int sizeIndex, symIndex, numeric = minNumeric;
|
||||
private File dir = new File(outDir, sizes[sizeIndex]);
|
||||
|
||||
@Override
|
||||
protected DownloadJob computeNext() {
|
||||
String sym;
|
||||
if(symIndex < symbols.length) {
|
||||
if (symIndex < symbols.length) {
|
||||
sym = symbols[symIndex++];
|
||||
} else if(numeric <= maxNumeric) {
|
||||
} else if (numeric <= maxNumeric) {
|
||||
sym = "" + (numeric++);
|
||||
} else {
|
||||
sizeIndex++;
|
||||
if(sizeIndex == sizes.length) {
|
||||
if (sizeIndex == sizes.length) {
|
||||
return endOfData();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue