board and piece : define height width and define piece color, position
This commit is contained in:
parent
9f7162ce6d
commit
4874c7c7a4
|
|
@ -4,18 +4,20 @@ import java.util.ArrayList;
|
|||
|
||||
public class Board {
|
||||
|
||||
private int width;
|
||||
private int height;
|
||||
|
||||
public Board(int colNum, int lineNum) {
|
||||
//TODO
|
||||
this.width = colNum;
|
||||
this.height = lineNum;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
//TODO
|
||||
return 0;
|
||||
return width;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
//TODO
|
||||
return 0;
|
||||
return height;
|
||||
}
|
||||
|
||||
public int getTurnNumber() {
|
||||
|
|
|
|||
|
|
@ -1,21 +1,31 @@
|
|||
package backend;
|
||||
|
||||
public class Piece {
|
||||
private int x;
|
||||
private int y;
|
||||
private boolean pieceColor;
|
||||
private PieceType type;
|
||||
|
||||
public Piece(int x,int y, PieceType type,boolean pieceColor) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.pieceColor = pieceColor;
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return 0;
|
||||
return x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return 0;
|
||||
return y;
|
||||
}
|
||||
|
||||
public PieceType getType() {
|
||||
return null;
|
||||
return type;
|
||||
}
|
||||
|
||||
public boolean isWhite() {
|
||||
return false;
|
||||
public boolean isWhite(boolean PieceColor) {
|
||||
return pieceColor;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue