Package com.jcloisterzone.game

Examples of com.jcloisterzone.game.Snapshot.save()


            Snapshot snapshot = new Snapshot(game);
            if ("plain".equals(debugConfig.getSave_format())) {
                snapshot.setGzipOutput(false);
            }
            try {
                snapshot.save(new FileOutputStream(debugConfig.getAutosave()));
            } catch (TransformerException | IOException e) {
                logger.error("Auto save before ranking failed.", e);
            }
        }
    }
View Full Code Here


        zos.closeEntry();

        ze = new ZipEntry("savegame.jcz");
        zos.putNextEntry(ze);
        Snapshot snapshot = new Snapshot(game);
        snapshot.save(zos, false, false);
        zos.closeEntry();

        if (container != null) {
            ze = new ZipEntry("board.png");
            zos.putNextEntry(ze);
View Full Code Here

    protected String snapshotGame(Game game) {
        try {
            ByteArrayOutputStream os = new ByteArrayOutputStream();
            Snapshot snapshot = new Snapshot(game);
            snapshot.setGzipOutput(false);
            snapshot.save(os);
            return os.toString("utf-8");
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

                    Snapshot snapshot = new Snapshot(game);
                    DebugConfig debugConfig = getConfig().getDebug();
                    if (debugConfig != null && "plain".equals(debugConfig.getSave_format())) {
                        snapshot.setGzipOutput(false);
                    }
                    snapshot.save(new FileOutputStream(file));
                } catch (IOException | TransformerException ex) {
                    logger.error(ex.getMessage(), ex);
                    JOptionPane.showMessageDialog(this, ex.getLocalizedMessage(), _("Error"), JOptionPane.ERROR_MESSAGE);
                }
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.