Examples of CaptureList


Examples of com.barrybecker4.game.common.board.CaptureList


    private int addJumpMoves(BoardPosition pos, int rowInc, TwoPlayerMove lastMove,
                             BoardPosition next, BoardPosition beyondNext, MoveList moveList) {
       CheckersMove m;
       CaptureList capture = new CaptureList();
       capture.add( next.copy() );
       m = CheckersMove.createMove( pos.getLocation(), beyondNext.getLocation(),
                                    capture, lastMove.getValue(), pos.getPiece().copy() );

       List<CheckersMove> jumps = findJumpMoves( beyondNext, rowInc, m, weights_ );
       moveList.addAll( jumps );
View Full Code Here

Examples of com.barrybecker4.game.common.board.CaptureList

        // loop through the possible moves.
        // if any of them capture the king then the opponents king is in check.
        for (Object move : moves) {
            ChessMove nextMove = (ChessMove) move;
            CaptureList cl = nextMove.captureList;
            if (null != cl && !cl.isEmpty()) {
                ChessPiece piece = (ChessPiece)cl.getFirst().getPiece();
                if (piece.is(ChessPieceType.KING)) {
                    checked = true;
                    break;
                }
            }
View Full Code Here

Examples of com.barrybecker4.game.common.board.CaptureList

     */
    public static boolean isTakeBack( int row, int col, GoMove lastMove, GoBoard board ) {

        if ( lastMove == null ) return false;

        CaptureList captures = lastMove.getCaptures();
        if ( captures != null && captures.size() == 1 ) {
            GoBoardPosition capture = (GoBoardPosition) captures.getFirst();
            if ( capture.getRow() == row && capture.getCol() == col ) {
                GoBoardPosition lastStone =
                        (GoBoardPosition) board.getPosition( lastMove.getToRow(), lastMove.getToCol() );
                if ( lastStone.getNumLiberties( board ) == 1 && lastStone.getString().getMembers().size() == 1 ) {
                    GameContext.log( 2, "it is a takeback " );
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.