Package com.jcloisterzone.figure

Examples of com.jcloisterzone.figure.Meeple


    }

    private void scoreCastle(Castle castle, int points) {
        List<Meeple> meeples = castle.getMeeples();
        if (meeples.isEmpty()) meeples = castle.getSecondFeature().getMeeples();
        Meeple m = meeples.get(0); //all meeples must share same owner
        m.getPlayer().addPoints(points, PointCategory.CASTLE);
        game.post(new ScoreEvent(m.getFeature(), points, PointCategory.CASTLE, m));
        undeloyMeeple(m);
    }
View Full Code Here


    @Override
    public void deployMeeple(Position p, Location loc, Class<? extends Meeple> meepleType) {
        if (!meepleType.equals(flierCap.getMeepleType())) {
            throw new IllegalArgumentException("Invalid meeple type.");
        }
        Meeple m = getActivePlayer().getMeepleFromSupply(meepleType);
        Tile tile = getBoard().get(p);
        m.deploy(tile, loc);
        next();
    }
View Full Code Here

    public void undeployMeeple(Position p, Location loc, Class<? extends Meeple> meepleType, Integer meepleOwner) {
        if (cornCircleCap.getCornCircleOption() != CornCicleOption.REMOVAL) {
            logger.error("Removal not selected as corn options.");
            return;
        }
        Meeple m = game.getMeeple(p, loc, meepleType, game.getPlayer(meepleOwner));
        Class<? extends Feature> cornType = getTile().getCornCircle();
        if (!cornType.isInstance(m.getFeature())) {
            logger.error("Improper feature type");
            return;
        }
        m.undeploy();
        nextCornPlayer();
    }
View Full Code Here

        if (meeples.get(0).getPlayer() != getActivePlayer()) {
            logger.error("Feature must be occupies with own follower");
            return;
        }

        Meeple m = getActivePlayer().getMeepleFromSupply(meepleType);
        Tile tile = getBoard().get(p);
        m.deploy(tile, loc);
        nextCornPlayer();
    }
View Full Code Here

        if (!meepleType.equals(Wagon.class)) {
            logger.error("Illegal figure type.");
            return;
        }
        Player player = wagonCap.getWagonPlayer();
        Meeple m = player.getMeepleFromSupply(Wagon.class);
        m.deployUnoccupied(getBoard().get(p), loc);
        wagonCap.removeScoredWagon(player);
        enter();
    }
View Full Code Here

        return tileHasPrincess && m.getFeature() instanceof City;
    }

    @Override
    public void undeployMeeple(Position p, Location loc, Class<? extends Meeple> meepleType, Integer meepleOwner) {
        Meeple m = game.getMeeple(p, loc, meepleType, game.getPlayer(meepleOwner));
        boolean princess = isPrincessUndeploy(m);
        if (isFestivalUndeploy(m) || princess) {
            m.undeploy();
            if (princess) {
                princessCapability.setPrincessUsed(true);
            }
            next();
        } else {
View Full Code Here

    }


    @Override
    public void deployMeeple(Position p, Location loc, Class<? extends Meeple> meepleType) {
        Meeple m = getActivePlayer().getMeepleFromSupply(meepleType);
        m.deployUnoccupied(getBoard().get(p), loc);
        if (portalCap != null && loc != Location.TOWER && getTile().hasTrigger(TileTrigger.PORTAL) && !p.equals(getTile().getPosition())) {
            //magic gate usage
            portalCap.setPortalUsed(true);
        }
        next();
View Full Code Here

    @Override
    public void deployMeeple(Position p, Location loc, Class<? extends Meeple> meepleType) {
        if (!meepleType.equals(Phantom.class)) {
            throw new IllegalArgumentException("Only phantom can be placed as second follower.");
        }
        Meeple m = getActivePlayer().getMeepleFromSupply(meepleType);
        m.deployUnoccupied(getBoard().get(p), loc);
        next();
    }
View Full Code Here


    @Override
    public void undeployMeeple(Position p, Location loc, Class<? extends Meeple> meepleType, Integer meepleOwner) {
        assert meepleOwner == getActivePlayer().getIndex();
        Meeple m = game.getMeeple(p, loc, meepleType, game.getPlayer(meepleOwner));
        if (!(m.getFeature() instanceof City)) {
            logger.error("Feature for escape action must be a city");
            return;
        }
        m.undeploy();
        next();
    }
View Full Code Here

            NodeList priosonerNl = playerEl.getElementsByTagName("prisoner");
            for (int j = 0; j < priosonerNl.getLength(); j++) {
                Element prisonerEl = (Element) priosonerNl.item(j);
                int ownerIndex = XmlUtils.attributeIntValue(prisonerEl, "player");
                Class<? extends Meeple> meepleClass = (Class<? extends Meeple>) XmlUtils.classForName(prisonerEl.getAttribute("type"));
                Meeple m = game.getPlayer(ownerIndex).getMeepleFromSupply(meepleClass);
                inprison(m, player);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.jcloisterzone.figure.Meeple

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.