Package com.jcloisterzone.board

Examples of com.jcloisterzone.board.Location.intersect()


    private boolean isBridgePlacementAllowed(Tile tile, Position p, Location bridgeLoc) {
        if (!tile.isBridgeAllowed(bridgeLoc)) return false;
        for (Entry<Location, Tile> e : getBoard().getAdjacentTilesMap(p).entrySet()) {
            Location rel = e.getKey();
            if (rel.intersect(bridgeLoc) != null) {
                Tile adjacent = e.getValue();
                char adjacentSide = adjacent.getEdge(rel.rev());
                if (adjacentSide != 'R') return false;
            }
        }
View Full Code Here


            Tile adjacent = e.getValue();
            Location rel = e.getKey();

            char adjacentSide = adjacent.getEdge(rel.rev());
            char tileSide = tile.getEdge(rel);
            if (rel.intersect(bridgeLoc) != null) {
                if (adjacentSide != 'R') return false;
            } else {
                if (adjacentSide != tileSide) return false;
            }
        }
View Full Code Here

            //check U-turn
            Location continueRiver = tile.getRiver().rotateCW(tile.getRotation()).substract(tileRelativePosition);
            if (continueRiver == Location.INNER_FARM) return true; //lake
            for (Location continueSide: Location.sides()) { //split beacuse of river fork
                if (continueRiver.intersect(continueSide) == null) continue;
                Position pCheck = p.add(continueSide).add(continueSide.rotateCW(Rotation.R90));
                if (getBoard().get(pCheck) != null) return false;
                pCheck = p.add(continueSide).add(continueSide.rotateCCW(Rotation.R90));
                if (getBoard().get(pCheck) != null) return false;
                pCheck = p.add(continueSide).add(continueSide);
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.