Package com.jcloisterzone.action

Examples of com.jcloisterzone.action.UndeployAction


        }
        return actions;
    }

    private List<PlayerAction<?>> prepareRemovalAction(Class<? extends Feature> cornType) {
      UndeployAction action = null;
        for (Meeple m : game.getDeployedMeeples()) {
            if (!(m instanceof Follower)) continue;
            if (m.getPlayer() != getActivePlayer()) continue;
            if (!cornType.isInstance(m.getFeature())) continue;
            if (action == null) {
                action = new UndeployAction("undeploy");
            }
            action.add(new MeeplePointer(m));
        }
        if (action == null) return Collections.emptyList();
        return Collections.<PlayerAction<?>>singletonList(action);
    }
View Full Code Here


    @Override
    public void prepareActions(List<PlayerAction<?>> actions, Set<FeaturePointer> followerOptions) {
        if (!getTile().hasTrigger(TileTrigger.FESTIVAL)) return;

        Player activePlayer = game.getActivePlayer();
        UndeployAction action = new UndeployAction(UNDEPLOY_FESTIVAL);

        for (Meeple m : Iterables.filter(activePlayer.getMeeples(), MeeplePredicates.deployed())) {
            action.add(new MeeplePointer(m));
        }
        if (!action.isEmpty()) {
            actions.add(action);
        }
    }
View Full Code Here

        return game.hasCapability(SiegeCapability.class);
    }

    @Override
    public void enter() {
        UndeployAction action = prepareEscapeAction();
        if (prepareEscapeAction() != null) {
            game.post(new SelectActionEvent(getActivePlayer(), action, true));
        } else {
            next();
        }
View Full Code Here

        }
    }


    public UndeployAction prepareEscapeAction() {
        UndeployAction escapeAction = null;
        for (Meeple m : game.getDeployedMeeples()) {
            if (m.getPlayer() != getActivePlayer()) continue;
            if (!(m.getFeature() instanceof City)) continue;

            FeatureVisitor<Boolean> visitor = game.hasRule(CustomRule.ESCAPE_RGG) ? new FindNearbyCloisterRgg() : new FindNearbyCloister();
            if (m.getFeature().walk(visitor)) {
                if (escapeAction == null) {
                    escapeAction = new UndeployAction(SiegeCapability.UNDEPLOY_ESCAPE);
                }
                escapeAction.add(new MeeplePointer(m));
            }
        }
        return escapeAction;
    }
View Full Code Here

TOP

Related Classes of com.jcloisterzone.action.UndeployAction

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.