Package com.barrybecker4.puzzle.tantrix.model

Examples of com.barrybecker4.puzzle.tantrix.model.TilePlacement.rotate()


            Piece p = SHUFFLED_PIECES.get(i);
            if (!position.contains(p)) {
                int r = 0;
                // see if any of the rotations fit.
                while (!position.fits(p) && r < 4) {
                    p = p.rotate();
                    r++;
                }
                if (r < 4) {
                    moves.add(p);
                }
View Full Code Here


                    // call solvePuzzle with a simpler case (one less piece to solve)
                    pieces = solvePuzzle( puzzlePanel, pieces, k);
                    solved = pieces.size() == 0;
                }
                if (!solved) {
                    p = p.rotate();
                }
                r++;
            }
            k++;
        }
View Full Code Here

        for (int i = 0; i < NUM_SIDES; i++) {
            if (isFit(placement)) {
                validPlacements.add(placement);
            }
            placement = placement.rotate();
        }
        return validPlacements;
    }

    /**
 
View Full Code Here

        TilePlacement newPlacement =
                new TilePlacement(tile, location, Rotation.ANGLE_0);
        int ct = 0;
        while (!fitter.isFit(newPlacement) && ct < HexTile.NUM_SIDES) {
            //System.out.println("new placement = " + newPlacement);
            newPlacement = newPlacement.rotate();
            ct++;
        }
        if (ct >= HexTile.NUM_SIDES) {
            throw new IllegalStateException("could not fit " + tile + " at " + location + " in " + fitter.getTantrix());
        }
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.