oard java and piece java new
This commit is contained in:
parent
2f24aa722d
commit
6d42ba903a
|
|
@ -3,19 +3,25 @@ package backend;
|
|||
import java.util.ArrayList;
|
||||
|
||||
public class Board {
|
||||
|
||||
//Board dimensions
|
||||
private int width;
|
||||
private int height;
|
||||
|
||||
public Board(int colNum, int lineNum) {
|
||||
this.width = colNum;
|
||||
this.height = lineNum;
|
||||
//TODO
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
//TODO
|
||||
return 0;
|
||||
return width;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
//TODO
|
||||
return 0;
|
||||
return height;
|
||||
}
|
||||
|
||||
public int getTurnNumber() {
|
||||
|
|
|
|||
|
|
@ -1,21 +1,38 @@
|
|||
package backend;
|
||||
|
||||
public class Piece {
|
||||
//Variables to store piece properties
|
||||
private int x;
|
||||
private int y;
|
||||
private PieceType type;
|
||||
private boolean isWhite;
|
||||
|
||||
public Piece(int x, int y, PieceType type, boolean isWhite) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.type = type;
|
||||
this.isWhite = isWhite;
|
||||
}
|
||||
|
||||
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;
|
||||
return isWhite;
|
||||
}
|
||||
|
||||
public void setPosition(int x, int y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue