use of org.magic.api.beans.MagicCardStock in project MtgDesktopCompanion by nicho92.
the class MTGODeckExport method exportStock.
@Override
public void exportStock(List<MagicCardStock> stock, File f) throws IOException {
MagicDeck d = new MagicDeck();
d.setName(f.getName());
for (MagicCardStock mcs : stock) {
d.getMap().put(mcs.getMagicCard(), mcs.getQte());
}
export(d, f);
}
use of org.magic.api.beans.MagicCardStock in project MtgDesktopCompanion by nicho92.
the class MagicWorkStationDeckExport method exportStock.
@Override
public void exportStock(List<MagicCardStock> stock, File f) throws IOException {
MagicDeck d = new MagicDeck();
d.setName(f.getName());
for (MagicCardStock mcs : stock) {
d.getMap().put(mcs.getMagicCard(), mcs.getQte());
}
export(d, f);
}
use of org.magic.api.beans.MagicCardStock in project MtgDesktopCompanion by nicho92.
the class ManualImportExport method importStock.
@Override
public List<MagicCardStock> importStock(File f) throws IOException {
MagicDeck d = importDeck(f);
List<MagicCardStock> ret = new ArrayList<>();
for (MagicCard mc : d.getMap().keySet()) {
MagicCardStock stock = new MagicCardStock();
stock.setMagicCard(mc);
stock.setQte(d.getMap().get(mc));
stock.setUpdate(true);
stock.setIdstock(-1);
ret.add(stock);
}
return ret;
}
use of org.magic.api.beans.MagicCardStock in project MtgDesktopCompanion by nicho92.
the class MkmOnlineExport method exportStock.
@Override
public void exportStock(List<MagicCardStock> stock, File f) throws IOException {
if (!getString("STOCK_USE").equals("true")) {
MagicDeck d = new MagicDeck();
d.setName(f.getName());
for (MagicCardStock mcs : stock) {
d.getMap().put(mcs.getMagicCard(), mcs.getQte());
}
export(d, f);
} else {
StockService serv = new StockService();
ProductServices prods = new ProductServices();
EnumMap<PRODUCT_ATTS, String> enumAtts = new EnumMap<>(PRODUCT_ATTS.class);
enumAtts.put(PRODUCT_ATTS.idGame, "1");
enumAtts.put(PRODUCT_ATTS.exact, "true");
List<Article> list = new ArrayList<>();
for (MagicCardStock mcs : stock) {
Product p = MagicCardMarketPricer2.getProductFromCard(mcs.getMagicCard(), prods.findProduct(mcs.getMagicCard().getName(), enumAtts));
Article a = new Article();
a.setAltered(mcs.isAltered());
a.setSigned(mcs.isSigned());
a.setCount(mcs.getQte());
a.setFoil(mcs.isFoil());
a.setPrice(mcs.getPrice());
a.setCondition(convert(mcs.getCondition()));
a.setLanguage(convertLang(mcs.getLanguage()));
a.setProduct(p);
a.setIdProduct(p.getIdProduct());
list.add(a);
}
serv.addArticles(list);
}
}
use of org.magic.api.beans.MagicCardStock in project MtgDesktopCompanion by nicho92.
the class PDFExport method exportStock.
@Override
public void exportStock(List<MagicCardStock> stock, File f) throws IOException {
MagicDeck d = new MagicDeck();
d.setName(f.getName());
for (MagicCardStock mcs : stock) {
d.getMap().put(mcs.getMagicCard(), mcs.getQte());
}
export(d, f);
}
Aggregations