diff --git a/src/schack/Bishop.java b/src/schack/Bishop.java index 00f3e89..3bd5fa8 100644 --- a/src/schack/Bishop.java +++ b/src/schack/Bishop.java @@ -8,8 +8,9 @@ import java.util.logging.Logger; public class Bishop extends Piece { - public Bishop(boolean isWhite, Point startingPosition) { + public Bishop(boolean isWhite, Point startingPosition) throws IOException { super(isWhite, startingPosition); + setPieceIcon("Bishop"); } @Override @@ -59,7 +60,7 @@ public class Bishop extends Piece { public void move(Piece[][] pieces) { throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody } - + @Override public String toString() { return "Bishop{" + "position=" + position + ", isWhite=" + isWhite + '}'; diff --git a/src/schack/Board.java b/src/schack/Board.java index 69bbd72..9daeefd 100644 --- a/src/schack/Board.java +++ b/src/schack/Board.java @@ -25,10 +25,10 @@ public class Board extends JPanel { private Piece[][] initPieces() throws IOException { Piece[][] piecesRet = { - {null, null, null, null, null, null, null, null}, - {null, null, null, null, null, null, null, null}, - {null, null, null, null, null, null, null, null}, - {null, null, null, null, null, null, null, null}, + {new Rook(false, new Point(0, 0)), null, null, null, null, null, null, new Rook(true, new Point(0, 7))}, + {new Horse(false, true, new Point(1, 0)), null, null, null, null, null, null, new Horse(true, true, new Point(1, 7))}, + {new Bishop(false, new Point(2, 0)), null, null, null, null, null, null, new Bishop(true, new Point(2, 7))}, + {new Queen(false, new Point(3, 0)), null, null, null, null, null, null, new Queen(true, new Point(3, 7))}, {new King(false), null, null, null, null, null, null, new King(true)}, {null, null, null, null, null, null, null, null}, {null, null, null, null, null, null, null, null}, @@ -44,9 +44,6 @@ public class Board extends JPanel { piecesRet[i][1] = new Pawn(false, new Point(i, 1)); piecesRet[i][6] = new Pawn(true, new Point(i, 6)); } - - - // // Sätt ut bönder no point // for (int i = 0; i < pieces.length; i++) { diff --git a/src/schack/DiagonalWalk.java b/src/schack/DiagonalWalk.java index bcc9d1b..0d76dd6 100644 --- a/src/schack/DiagonalWalk.java +++ b/src/schack/DiagonalWalk.java @@ -1,14 +1,5 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ package schack; -/** - * - * @author lovbil251 - */ public interface DiagonalWalk { default void walDiagonal(Piece[][] pieces){