Examples of MoveList


Examples of com.barrybecker4.game.common.MoveList

     */
    protected void restoreGame( SGFGame game )
    {
        parseSGFGameInfo(game);

        MoveList moveSequence = new MoveList();
        extractMoveList( game.getTree(), moveSequence );
        GameContext.log( 1, "move sequence= " + moveSequence );
        controller_.reset();

        for (Move m : moveSequence) {
View Full Code Here

Examples of com.barrybecker4.game.common.MoveList

    /**
     * Default constructor
     */
    public Board() {
        moveList_ = new MoveList();
    }
View Full Code Here

Examples of com.barrybecker4.game.common.MoveList

     * The computer makes the first move in the game.
     */
    @Override
    public void computerMovesFirst() {
        // determine the possible moves and choose one at random.
        MoveList moveList = getSearchable().generateMoves( null, weights_.getPlayer1Weights());

        assert (!moveList.isEmpty());
        makeMove( moveList.getRandomMove() );

        player1sTurn_ = false;
    }
View Full Code Here

Examples of com.barrybecker4.game.common.MoveList

    public MoveList generateMoves(TwoPlayerMove lastMove) {

        int j, row,col;
        boolean player1 = (lastMove == null) || !(lastMove.isPlayer1());
        MoveList moveList = new MoveList();

        // scan through the board positions. For each each piece of the current player's,
        // add all the moves that it can make.
        for ( row = 1; row <= CheckersBoard.SIZE; row++ ) {
            int odd = row % 2;
View Full Code Here

Examples of com.barrybecker4.game.common.MoveList

    /**
     *  generate all possible next moves.
     */
   @Override
   public MoveList generateMoves( TwoPlayerMove lastMove, ParameterArray weights) {
       MoveList moveList = new MoveList();
       int row,col;

       boolean player1 = (lastMove == null) || !(lastMove.isPlayer1());

       // scan through the board positions. For each each piece of the current player's,
View Full Code Here

Examples of com.barrybecker4.game.common.MoveList

    * TODO
    * @return those moves that result in check or getting out of check.
    */
   @Override
   public MoveList generateUrgentMoves(TwoPlayerMove lastMove, ParameterArray weights) {
       return new MoveList();
   }
View Full Code Here

Examples of com.barrybecker4.game.common.MoveList

     */
    @Override
    public void computerMovesFirst() {

        // determine the possible moves and choose one at random.
        MoveList moveList = getSearchable().generateMoves( null, weights_.getPlayer1Weights());

        makeMove( moveList.getRandomMove() );
        player1sTurn_ = false;
    }
View Full Code Here

Examples of com.barrybecker4.game.common.MoveList

    public MoveList generateMoves(TwoPlayerMove lastMove, ParameterArray weights) {

        MoveGenerator generator = new MoveGenerator(this, weights);
        boolean player1 = (lastMove == null) || !lastMove.isPlayer1();

        MoveList moveList = generator.generateMoves(lastMove);

        return bestMoveFinder_.getBestMoves( player1, moveList);
    }
View Full Code Here

Examples of com.barrybecker4.game.common.MoveList

     * @return list of urgent moves
     */
    @Override
    public MoveList generateUrgentMoves(
            TwoPlayerMove lastMove, ParameterArray weights) {
        return new MoveList();
    }
View Full Code Here

Examples of com.barrybecker4.game.common.MoveList

        TwoPlayerMove lastMove = (TwoPlayerMove)controller.getLastMove();
        MoveGenerator generator =
                new MoveGenerator((CheckersSearchable)controller.getSearchable(),
                                  controller.getComputerWeights().getDefaultWeights());

        MoveList possibleMoveList = new MoveList();
        generator.addMoves(position, lastMove, possibleMoveList);
        return possibleMoveList;
    }
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.