started on b
This commit is contained in:
parent
49262c4954
commit
440eed0e9d
Binary file not shown.
Binary file not shown.
@ -4,10 +4,14 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import uebung09.iterator.Array2dIterator;
|
import uebung09.iterator.Array2dIterator;
|
||||||
|
|
||||||
public class Board extends Array2dIterator<Piece> {
|
public class Board extends Array2dIterator<Piece>{
|
||||||
private final Piece[][] field = new Piece[8][8];
|
private final Piece[][] field = new Piece[8][8];
|
||||||
private final List<Piece> pieces = new ArrayList<>();
|
private final List<Piece> pieces = new ArrayList<>();
|
||||||
|
|
||||||
|
Board(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void add(Piece piece) {
|
void add(Piece piece) {
|
||||||
if (piece.getBoard() != this)
|
if (piece.getBoard() != this)
|
||||||
throw new IllegalArgumentException("wrong board");
|
throw new IllegalArgumentException("wrong board");
|
||||||
|
@ -12,6 +12,7 @@ public class ChessApp {
|
|||||||
private static final String BLACK_QUEEN = "Q";
|
private static final String BLACK_QUEEN = "Q";
|
||||||
private static final String WHITE_KNIGHT = "n";
|
private static final String WHITE_KNIGHT = "n";
|
||||||
private static final String BLACK_KNIGHT = "N";
|
private static final String BLACK_KNIGHT = "N";
|
||||||
|
private static final String ITERATOR = "i";
|
||||||
|
|
||||||
private final Scanner scanner;
|
private final Scanner scanner;
|
||||||
private final Board board;
|
private final Board board;
|
||||||
|
Loading…
Reference in New Issue
Block a user