Search in sources :

Example 1 with MTGDesktopCompanionExport

use of org.magic.api.exports.impl.MTGDesktopCompanionExport in project MtgDesktopCompanion by nicho92.

the class MTGControler method saveDeck.

public void saveDeck(MagicDeck deck) throws IOException {
    if (!MTGConstants.MTG_DECK_DIRECTORY.exists())
        MTGConstants.MTG_DECK_DIRECTORY.mkdir();
    MTGDesktopCompanionExport serialis = new MTGDesktopCompanionExport();
    serialis.export(deck, new File(MTGConstants.MTG_DECK_DIRECTORY, deck.getName() + serialis.getFileExtension()));
}
Also used : MTGDesktopCompanionExport(org.magic.api.exports.impl.MTGDesktopCompanionExport) File(java.io.File)

Example 2 with MTGDesktopCompanionExport

use of org.magic.api.exports.impl.MTGDesktopCompanionExport in project MtgDesktopCompanion by nicho92.

the class ExportsProviderTests method initTests.

@Test
public void initTests() {
    MTGControler.getInstance().getEnabledProviders().init();
    testExports(new Apprentice2DeckExport());
    testExports(new CocatriceDeckExport());
    testExports(new CSVExport());
    testExports(new DCIDeckSheetExport());
    testExports(new JsonExport());
    testExports(new MKMFileWantListExport());
    testExports(new MTGDesktopCompanionExport());
    testExports(new MTGODeckExport());
    testExports(new OCTGNDeckExport());
    testExports(new PDFExport());
    testExports(new XMageDeckExport());
    testExports(new MagicWorkStationDeckExport());
    try {
        testExports(new MkmOnlineExport());
    } catch (MkmException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
Also used : MTGDesktopCompanionExport(org.magic.api.exports.impl.MTGDesktopCompanionExport) MagicWorkStationDeckExport(org.magic.api.exports.impl.MagicWorkStationDeckExport) MTGODeckExport(org.magic.api.exports.impl.MTGODeckExport) CocatriceDeckExport(org.magic.api.exports.impl.CocatriceDeckExport) CSVExport(org.magic.api.exports.impl.CSVExport) JsonExport(org.magic.api.exports.impl.JsonExport) MkmException(org.api.mkm.exceptions.MkmException) PDFExport(org.magic.api.exports.impl.PDFExport) MkmOnlineExport(org.magic.api.exports.impl.MkmOnlineExport) DCIDeckSheetExport(org.magic.api.exports.impl.DCIDeckSheetExport) OCTGNDeckExport(org.magic.api.exports.impl.OCTGNDeckExport) Apprentice2DeckExport(org.magic.api.exports.impl.Apprentice2DeckExport) MKMFileWantListExport(org.magic.api.exports.impl.MKMFileWantListExport) XMageDeckExport(org.magic.api.exports.impl.XMageDeckExport) Test(org.junit.Test)

Aggregations

MTGDesktopCompanionExport (org.magic.api.exports.impl.MTGDesktopCompanionExport)2 File (java.io.File)1 MkmException (org.api.mkm.exceptions.MkmException)1 Test (org.junit.Test)1 Apprentice2DeckExport (org.magic.api.exports.impl.Apprentice2DeckExport)1 CSVExport (org.magic.api.exports.impl.CSVExport)1 CocatriceDeckExport (org.magic.api.exports.impl.CocatriceDeckExport)1 DCIDeckSheetExport (org.magic.api.exports.impl.DCIDeckSheetExport)1 JsonExport (org.magic.api.exports.impl.JsonExport)1 MKMFileWantListExport (org.magic.api.exports.impl.MKMFileWantListExport)1 MTGODeckExport (org.magic.api.exports.impl.MTGODeckExport)1 MagicWorkStationDeckExport (org.magic.api.exports.impl.MagicWorkStationDeckExport)1 MkmOnlineExport (org.magic.api.exports.impl.MkmOnlineExport)1 OCTGNDeckExport (org.magic.api.exports.impl.OCTGNDeckExport)1 PDFExport (org.magic.api.exports.impl.PDFExport)1 XMageDeckExport (org.magic.api.exports.impl.XMageDeckExport)1