Package com.jcloisterzone.game.phase

Examples of com.jcloisterzone.game.phase.LoadGamePhase


    protected Game copyGame(Object gameListener) {
        Snapshot snapshot = new Snapshot(game);
        Game copy = snapshot.asGame(game.getGameId());
        copy.setConfig(game.getConfig());
        copy.getEventBus().register(gameListener);
        LoadGamePhase phase = new LoadGamePhase(copy, snapshot, getConnection());
        phase.setSlots(new PlayerSlot[0]);
        copy.getPhases().put(phase.getClass(), phase);
        copy.setPhase(phase);
        phase.startGame();
        return copy;
    }
View Full Code Here


        try {
            URI uri = getClass().getResource(save).toURI();
            Snapshot snapshot = new Snapshot(new File(uri));
            EventCatchingGame game = (EventCatchingGame) snapshot.asGame(new EventCatchingGame());
            game.setConfig(new Config());
            LoadGamePhase phase = new LoadGamePhase(game, snapshot, null);
            game.getPhases().put(phase.getClass(), phase);
            game.setPhase(phase);
            phase.setSlots(new PlayerSlot[0]);
            phase.startGame();
            game.events.clear();
            return game;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here

        if (snapshot == null) {
            game = new Game(msg.getGameId());
            phase = new CreateGamePhase(game, conn);
        } else {
            game = snapshot.asGame(msg.getGameId());
            phase = new LoadGamePhase(game, snapshot, conn);
        }
        game.setConfig(client.getConfig());

        final PlayerSlot[] slots = new PlayerSlot[PlayerSlot.COUNT];
View Full Code Here

TOP

Related Classes of com.jcloisterzone.game.phase.LoadGamePhase

Copyright © 2018 www.massapicom. 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.