This commit is contained in:
Johannes Schmelz 2024-06-13 15:02:04 +00:00
parent fa85372c13
commit 49262c4954
19 changed files with 35 additions and 9 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,9 +1,10 @@
package chess;
package uebung09.chess;
import java.util.ArrayList;
import java.util.List;
import uebung09.iterator.Array2dIterator;
public class Board {
public class Board extends Array2dIterator<Piece> {
private final Piece[][] field = new Piece[8][8];
private final List<Piece> pieces = new ArrayList<>();

View File

@ -1,4 +1,4 @@
package chess;
package uebung09.chess;
import java.io.InputStream;
import java.util.NoSuchElementException;

View File

@ -1,4 +1,4 @@
package chess;
package uebung09.chess;
public enum Color {
black, white

View File

@ -1,4 +1,4 @@
package chess;
package uebung09.chess;
import static java.lang.Math.abs;

View File

@ -1,4 +1,4 @@
package chess;
package uebung09.chess;
public abstract class Piece {
private Color color;

View File

@ -1,4 +1,4 @@
package chess;
package uebung09.chess;
import static java.lang.Integer.signum;
import static java.lang.Math.abs;

View File

@ -1,4 +1,4 @@
package collection;
package uebung09.collection;
/**
* A set of elements that does not contain any element twice.

View File

@ -1,4 +1,4 @@
package collection;
package uebung09.collection;
public class SetFactory {

View File

@ -0,0 +1,25 @@
package uebung09.iterator;
import java.util.Iterator;
public class Array2dIterator<T> implements Iterator<T>{
public <T> Array2dIterator(T[][] aaray) {
}
@Override
public boolean hasNext() {
// TODO Auto-generated method stub
return false;
}
@Override
public T next() {
// TODO Auto-generated method stub
return null;
}
}