Examples of EPiece


Examples of chesstrainer.util.EPiece

            g.fillRect(x, y, size, size);
        }
    }
   
    private void drawPieces(Graphics2D g, int size) {
        EPiece piece;
        int x, y;
        for (ESquare square : position.getPosition().keySet()) {
            if (blindfoldSquares.contains(square)) {
                continue;
            }
View Full Code Here

Examples of chesstrainer.util.EPiece

        String[] pieces = fen.split(" ");
       
        // pos
        String[] ranks = pieces[0].split("/");
        ESquare sq;
        EPiece piece;
       
        for (int i = 0; i < 8; i++) {
           
            int rank = 7 - i;
            int file = 0;
View Full Code Here

Examples of chesstrainer.util.EPiece

   
    public String getFEN() {
        String fen = "";
       
        ESquare sq;
        EPiece piece;
        for (int rank = 7; rank >= 0; rank--) {
            int empty = 0;
           
            for (int file = 0; file < 8; file++) {
                sq = ESquare.get(rank, file);
               
                if (position.containsKey(sq)) {
                    if (empty > 0) {
                        fen += String.valueOf(empty).trim();
                        empty = 0;
                    }
                    piece = position.get(sq);
                    fen += piece.toString();
                } else {
                    empty++;
                }
            }
           
View Full Code Here

Examples of chesstrainer.util.EPiece

        return fen;
    }
   
    public void makeMove(CMove move) {
       
        EPiece piece = position.get(move.getFrom());
        position.remove(move.getTo());
        position.remove(move.getFrom());
        position.put(move.getTo(), piece);
        if (move.getPromotion() != null) {
            position.remove(move.getTo());
View Full Code Here

Examples of chesstrainer.util.EPiece

        }
       
        ESquare to = null;
        Set<CMove> moves = position.getMoves();
        CMove move;
        EPiece piece;
        EPiece promotion = null;
       
        for (ESquare s : ESquare.values()) {
            if (san.contains(s.name())) {
                to = s;
                break;
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.