Package eu.semberal.migmang.enums

Examples of eu.semberal.migmang.enums.GameColor


    /**
     * Reverts a move on current board
     */
    public Board removeMoveAdvanced(Move move) {
        GameColor deletedColor = (move.getColor() == GameColor.White ? GameColor.Black : GameColor.White);
        addMoveWithoutCaptures(new Move(move.getTo(), move.getFrom(), move.getColor()));
        for (int i : move.getCapturedIndexes()) {
            this.setPiece(i, deletedColor);
        }
        return this;
View Full Code Here


     */
    public synchronized void updatePiecesCoordinates(boolean repaint) {


        if (currentBoard != null) {
            GameColor s;
            for (int i = 0; i < piecesTopLeftCorners.length; i++) {
                s = currentBoard.getSquare(i);
                int aktX, aktY;
                if (s == null) {
                    piecesTopLeftCorners[i] = null;
View Full Code Here

    /**
     * Evaluates a position for specific player
     */
    public static int evaluateBoard(Board board, GameColor color) {
        GameColor otherColor = (color == GameColor.White ? GameColor.Black : GameColor.White);
        int ret = 15 - board.getPiecesCount(otherColor);
        ret += board.getPiecesCount(color);
        ret *= MULTIPLICATION_COEFICIENT;
        ret += random.nextInt(MULTIPLICATION_COEFICIENT - 1);
        return ret;
View Full Code Here

    /**
     * Adds capturing information to a move
     */
    public static void addCaptureInformationToMove(Board board, Move move) {
        GameColor color = move.getColor();
        GameColor colorForCaptures = (color == GameColor.White ? GameColor.Black : GameColor.White);
        Board s = new Board(board).addMoveWithoutCaptures(move);

        if (move.getTo() == move.getFrom() + 2) { //if distance is 2, jump over occured and is necessary to delete piece in the middle
            move.addCapturedPieceIndex(move.getFrom() + 1);
        } else if (move.getTo() == move.getFrom() - 2) {
View Full Code Here

TOP

Related Classes of eu.semberal.migmang.enums.GameColor

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.