Package freecell.model.action

Examples of freecell.model.action.MoveAction


     * Moves cards from one pile to another, if the move is valid.
     */
    public boolean move(Pile fromPile, Pile toPile) {
        int cardsMoved = toPile.moveFrom(fromPile);
        if (cardsMoved > 0) {
            moveTracker.addMove(new MoveAction(fromPile, toPile, cardsMoved));
            return true;
        }
        return false;
    }
View Full Code Here


        public boolean hasLastMove() {
            return !previousMoves.isEmpty();
        }

        public MoveAction getLastMove() {
            MoveAction lastMove = previousMoves.pop();
            nextMoves.push(lastMove);
            return lastMove;
        }
View Full Code Here

        public boolean hasNextMove() {
            return !nextMoves.isEmpty();
        }

        public MoveAction getNextMove() {
            MoveAction nextMove = nextMoves.pop();
            previousMoves.push(nextMove);
            return nextMove;
        }
View Full Code Here

            previousMoves.push(nextMove);
            return nextMove;
        }

        public void addMove(MoveAction move) {
            MoveAction nextMove = nextMoves.peek();
            /*
             * if new move differs from saved next move,
             * clear the remaining next moves
             */
            if (move.equals(nextMove)) {
View Full Code Here

TOP

Related Classes of freecell.model.action.MoveAction

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.