Examples of FeaturePointer


Examples of com.jcloisterzone.board.pointer.FeaturePointer

        }
        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

Examples of com.jcloisterzone.board.pointer.FeaturePointer

        undeploy(true);
    }

    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

Examples of com.jcloisterzone.board.pointer.FeaturePointer

import com.jcloisterzone.board.pointer.FeaturePointer;

public class BridgeDeployedEvent extends FeatureEvent {

    public BridgeDeployedEvent(Player triggeringPlayer, Position position, Location location) {
        super(triggeringPlayer, new FeaturePointer(position, location));
    }
View Full Code Here

Examples of com.jcloisterzone.board.pointer.FeaturePointer

public class TunnelPiecePlacedEvent extends FeatureEvent {

    private boolean secondPiece;

    public TunnelPiecePlacedEvent(Player player, Position position, Location location, boolean secondPiece) {
        super(player, new FeaturePointer(position, location));
        this.secondPiece = secondPiece;
    }
View Full Code Here

Examples of com.jcloisterzone.board.pointer.FeaturePointer

                City princessCity = tile.getCityWithPrincess();
                if (princessCity != null) {
                    continue;
                }
            }
            pointers.add(new FeaturePointer(tile.getPosition(), loc));
        }
        return pointers;
    }
View Full Code Here

Examples of com.jcloisterzone.board.pointer.FeaturePointer

                if (isBarnCorner(corner, positionChange)) {
                    if (barnAction == null) {
                        barnAction = new BarnAction();
                        actions.add(barnAction);
                    }
                    barnAction.add(new FeaturePointer(pos, corner));
                }
                corner = corner.next();
                positionChange = positionChange.next();
            }
        }
View Full Code Here

Examples of com.jcloisterzone.board.pointer.FeaturePointer

        if (bridgeRequired) {
            BridgeAction action = bridgeCap.prepareMandatoryBridgeAction();

            assert action.getOptions().size() == 1;
            FeaturePointer bp = action.getOptions().iterator().next();

            bridgeCap.decreaseBridges(getActivePlayer());
            bridgeCap.deployBridge(bp.getPosition(), bp.getLocation());
        }
        getBoard().mergeFeatures(tile);

        next();
    }
View Full Code Here

Examples of com.jcloisterzone.board.pointer.FeaturePointer

    }

    private BridgeAction prepareTileBridgeAction(Tile tile, BridgeAction action, Location bridgeLoc) {
        if (isBridgePlacementAllowed(tile, tile.getPosition(), bridgeLoc)) {
            if (action == null) action = new BridgeAction();
            action.add(new FeaturePointer(tile.getPosition(), bridgeLoc));
        }
        return action;
    }
View Full Code Here

Examples of com.jcloisterzone.board.pointer.FeaturePointer

        List<FeaturePointer> pointers = new ArrayList<>();
        for (Meeple m : game.getDeployedMeeples()) {
            if (!(m instanceof Follower)) continue;
            if (m.getPlayer() != getActivePlayer()) continue;
            if (!cornType.isInstance(m.getFeature())) continue;
            pointers.add(new FeaturePointer(m.getPosition(), m.getLocation()));
        }
        if (pointers.isEmpty()) return Collections.emptyList();

        List<PlayerAction<?>> actions = new ArrayList<>();
        //TODO nice to do this in generic way independently on particular followers enumeration
View Full Code Here

Examples of com.jcloisterzone.board.pointer.FeaturePointer

        MeepleAction action = new MeepleAction(meepleType);
        for (Feature f : target.getFeatures()) {
            if (!(f instanceof Completable)) continue;
            if (f.walk(new IsCompleted())) continue;
            if (follower.isDeploymentAllowed(f).result) {
                action.add(new FeaturePointer(pos, f.getLocation()));
            }
        }
        if (action.isEmpty()) {
            next();
            return;
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.