Package com.jcloisterzone.event

Examples of com.jcloisterzone.event.MeepleEvent


        }
        feature.addMeeple(this);
        setPosition(tile.getPosition());
        setLocation(loc);
        setFeature(feature);
        game.post(new MeepleEvent(game.getActivePlayer(), this, null, new FeaturePointer(tile.getPosition(), loc)));
    }
View Full Code Here


    public void undeploy(boolean checkForLonelyBuilderOrPig) {
        assert location != null && location != Location.PRISON;
        FeaturePointer source = new FeaturePointer(getPosition(), location);
        feature.removeMeeple(this);
        clearDeployment();
        game.post(new MeepleEvent(game.getActivePlayer(), this, source, null));
    }
View Full Code Here

        String s1 = snapshotGame(game);
        Phase phase = game.getPhase();
        phase.deployMeeple(new Position(1, -3), Location.NE, BigFollower.class);
        assertEquals(1, game.events.size());

        MeepleEvent ev = (MeepleEvent) game.events.get(0);
        ev.undo(game);
        game.setPhase(phase);

        String s2 = snapshotGame(game);
        assertEquals(s1, s2);
    }
View Full Code Here

        String s1 = snapshotGame(game);
        Phase phase = game.getPhase();
        phase.deployMeeple(new Position(1, -2), Location.TOWER, SmallFollower.class);
        assertEquals(1, game.events.size());

        MeepleEvent ev = (MeepleEvent) game.events.get(0);
        ev.undo(game);
        game.setPhase(phase);

        String s2 = snapshotGame(game);
        assertEquals(s1, s2);
    }
View Full Code Here

            } else {
                f = tile.getFeature(m.getLocation());
            }
            m.setFeature(f);
            f.addMeeple(m);
            game.post(new MeepleEvent(null, m, null, new FeaturePointer(m.getPosition(), m.getLocation())));
        }
        tilePackFactory.activateGroups((DefaultTilePack) game.getTilePack());
    }
View Full Code Here

    }

    private Event freezeEvent(Event ev) {
        if (ev instanceof MeepleEvent) {
            //TODO is it really needed with new meeple events?
            MeepleEvent mev = (MeepleEvent) ev;
            Meeple m = mev.getMeeple();
            return new MeepleEvent(((MeepleEvent) ev).getTriggeringPlayer(), (Meeple) m.clone(), mev.getFrom(), mev.getTo());
        }
        return ev;
    }
View Full Code Here

TOP

Related Classes of com.jcloisterzone.event.MeepleEvent

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.