mirror of
https://github.com/lov3b/Schack.git
synced 2025-01-18 12:50:10 +01:00
Added more pieces
This commit is contained in:
parent
795bcf1345
commit
f00f0af75d
@ -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 + '}';
|
||||
|
@ -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++) {
|
||||
|
@ -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){
|
||||
|
Loading…
x
Reference in New Issue
Block a user