Examples of PathColor


Examples of com.barrybecker4.puzzle.tantrix.model.PathColor

        HexTile tile = tilePlacement.getTile();
        int pathStartIndex = getPathStartIndex(tile, pathNumber);

        int i = pathStartIndex + 1;

        PathColor pathColor = tile.getEdgeColor(pathStartIndex);
        while (pathColor != tile.getEdgeColor(i++)) {
            assert(i<6): "Should never exceed 6";
        }

        int pathEndIndex = i-1;
View Full Code Here

Examples of com.barrybecker4.puzzle.tantrix.model.PathColor

     */
    private int getPathStartIndex(HexTile tile, int pathNumber) {
        Set<PathColor> set = new HashSet<PathColor>();
        int i = 0;
        do {
            PathColor c = tile.getEdgeColor(i++);
            set.add(c);
        } while (set.size() <= pathNumber);
        return i-1;
    }
View Full Code Here

Examples of com.barrybecker4.puzzle.tantrix.model.PathColor

     * @return the next tile in the path if there is one. Otherwise null.
     */
    private TilePlacement findNeighborTile(TilePlacement currentPlacement, TilePlacement previousTile) {

        for (byte i = 0; i < NUM_SIDES; i++) {
            PathColor color = currentPlacement.getPathColor(i);
            if (color == board.getPrimaryColor()) {
                TilePlacement nbr = board.getNeighbor(currentPlacement, i);
                if (nbr != null && !nbr.equals(previousTile)) {
                    return nbr;
                }
View Full Code Here

Examples of com.barrybecker4.puzzle.tantrix.model.PathColor

        for (byte i=0; i < NUM_SIDES; i++) {
            TilePlacement nbr = getNeighbor(placement, i);

            if (nbr != null) {
                PathColor pathColor = placement.getPathColor(i);

                if (pathColor == nbr.getPathColor((byte)(i+3))) {
                    if (pathColor == primaryColor) {
                        primaryPathMatched = true;
                    }
View Full Code Here

Examples of com.barrybecker4.puzzle.tantrix.model.PathColor

        boolean fits = true;
        for (byte i = 0; i < NUM_SIDES; i++) {
            TilePlacement nbr = tantrix.getNeighbor(placement, i);

            if (nbr != null) {
                PathColor pathColor = placement.getPathColor(i);
                PathColor nbrColor = nbr.getPathColor(i+3);

                if ((pathColor == primaryColor || nbrColor == primaryColor) && pathColor != nbrColor) {
                    fits = false;
                }
            }
View Full Code Here

Examples of com.barrybecker4.puzzle.tantrix.model.PathColor

        int numFits = 0;
        for (byte i = 0; i < NUM_SIDES; i++) {
            TilePlacement nbr = tantrix.getNeighbor(placement, i);

            if (nbr != null) {
                PathColor pathColor = placement.getPathColor(i);

                if (pathColor == primaryColor && pathColor == nbr.getPathColor(i+3)) {
                    numFits++;
                }
            }
View Full Code Here

Examples of com.barrybecker4.puzzle.tantrix.model.PathColor

     * @param subPath1 path coming out of pivot tile
     * @param subPath2 the other path coming out of pivot tile.
     * @return list of permuted paths.
     */
    private List<TantrixPath> createPermutedPathList(TantrixPath subPath1, TantrixPath subPath2) {
        PathColor primaryColor = path_.getPrimaryPathColor();
        SubPathMutator swapper = new SubPathSwapper(primaryColor);
        SubPathMutator reverser = new SubPathReverser(primaryColor);
        TilePlacement firstPivot = pivotPath.getFirst();
        TilePlacement lastPivot = pivotPath.getLast();

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.