Package com.jcloisterzone.feature

Examples of com.jcloisterzone.feature.Road


        if (getTile().isAbbeyTile()) {
            scoreCompletedNearAbbey(pos);
        }

        if (tunnelCap != null) {
            Road r = tunnelCap.getPlacedTunnel();
            if (r != null) {
                scoreCompleted(r, true);
            }
        }
View Full Code Here


        }
    }

    private void processRoadElement(String[] sides, Element e, boolean isTunnelActive) {
        //Road road = new Road(tile, sides.length, sides.length == 1 && attributeBoolValue(e, "tunnel"));
        Road road = new Road();
        road.setId(game.idSequnceNextVal());
        if (isTunnelActive && attributeBoolValue(e, "tunnel")) {
            road.setTunnelEnd(Road.OPEN_TUNNEL);
        }
        initFromDirList(road, sides);
        game.initFeature(tile, road, e);
    }
View Full Code Here

    }

    @Override
    public void initFeature(Tile tile, Feature feature, Element xml) {
        if (!(feature instanceof Road)) return;
        Road road = (Road) feature;
        if (road.isTunnelEnd()) {
            tunnels.add(road);
        }
    }
View Full Code Here

    private int getTunnelId(Player p, boolean isB) {
        return p.getIndex() + (isB ? 100 : 0);
    }

    public void placeTunnelPiece(Position p, Location loc, boolean isB) {
        Road road = (Road) getBoard().get(p).getFeature(loc);
        if (!road.isTunnelOpen()) {
            throw new IllegalStateException("No open tunnel here.");
        }
        placedTunnelCurrentTurn = road;
        Player player = game.getActivePlayer();
        placeTunnelPiece(road, player, p, loc, isB);
View Full Code Here

        nl = node.getElementsByTagName("tunnel");
        for (int i = 0; i < nl.getLength(); i++) {
            Element el = (Element) nl.item(i);
            Position pos = XmlUtils.extractPosition(el);
            Location loc = Location.valueOf(el.getAttribute("location"));
            Road road = (Road) getBoard().get(pos).getFeature(loc);
            if (!road.isTunnelEnd()) {
                logger.error("Tunnel end does not exist.");
                continue;
            }
            Player player = game.getPlayer(Integer.parseInt(el.getAttribute("player")));
            boolean isB = "yes".equals(el.getAttribute("b"));
View Full Code Here

TOP

Related Classes of com.jcloisterzone.feature.Road

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.